Jump to content

session_id simple question


redbrad0

Recommended Posts

I have never had the need to use the users session id, but now I am in need and I know this will be a quick and basic question.

 

If I write the session_id onto the webpage, the number changes all the time (when cookies are disabled). Shouldn't this number always stay the same?

 

echo session_id();

Link to comment
Share on other sites

The user must provide the session ID. There is no way for the server to track the user. Normally, the session ID is set in a cookie. If you're really against this, you can set PHP to pass the ID around in the URL or in hidden fields. This is not without its own set of problems, however.

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.