Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is PHPSESSID?

Tags:

php

cookies

People also ask

What is Phpsessid cookie what is its use?

PHP uses one of two methods to keep track of sessions. If cookies are enabled, like in your case, it uses them. If cookies are disabled, it uses the URL. Although this can be done securely, it's harder and it often, well, isn't.

How are Phpsessid generated?

It is generated when first accessing the website and sent to the client in the initial response headers. For the session to "stick", the client must include that cookie in every later request to the server. But on the server side, the PHPSESSID cookie has an expiration date (in my case after 20 minutes).

Is Phpsessid secure?

The PHPSESSID is stored in the clients cookie so I don't consider it as secure. Someone might bruteforce it and perform some action (like a Facebook status post) whenever a session was successfully hijacked.

Where is Phpsessid stored?

Sessions Need Cookies on Client End: In PHP, by default session data is stored in files on the server. Each file is named after a cookie that is stored on the client computer. This session cookie (PHPSESSID) presumably survives on the client side until all windows of the browser are closed.


PHP uses one of two methods to keep track of sessions. If cookies are enabled, like in your case, it uses them.

If cookies are disabled, it uses the URL. Although this can be done securely, it's harder and it often, well, isn't. See, e.g., session fixation.

Search for it, you will get lots of SEO advice. The conventional wisdom is that you should use the cookies, but php will keep track of the session either way.


PHPSESSID reveals you are using PHP. If you don't want this you can easily change the name using the session.name in your php.ini file or using the session_name() function.


It's the identifier for your current session in PHP. If you delete it, you won't be able to access/make use of session variables. I'd suggest you keep it.


Check php.ini for auto session id.

If you enable it, you will have PHPSESSID in your cookies.