Jump to content

[SOLVED] Whats the point in Session id?


phpSensei

Recommended Posts

In normal operation, the session id is placed in a cookie.  The user's browser sends that to identify the session.  PHP stores the session's data in a file using the session id as part of the name.

 

It can be used in other ways (such as added to a url) and session data can be stored elsewhere (such as in a database), so the above is just the default mode of operation.

Sessions are usually used to track a particular user, and very often used to record that they are logged in.

 

Session ids are part of the mechanism of sessions, which can be used to track a user, so the session id directly doesn't tell you the user is online.  It's the session id as well as the contents of the session (such as $_SESSION['logged_in'] = true) that tells you the user is online.

 

Yes, the id set for you automatically when you register the session.  The cookie is also automatically set.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.