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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.