By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,230 Members | 1,278 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,230 IT Pros & Developers. It's quick & easy.

Quick Session Question

P: n/a
I read and reread the PHP manual about sessions, and I have a quick
question. What causes the session id to change? I tried destroying the
session and unsetting the session vars, but it maintains the same id.

Just so you know, I don't need to make the session id change for any
reason. I'd just like to know what to avoid since I'm going to be storing
data the user enters with their sessionid and I'd like to make sure that
they can still access it through their entire visit.
Jul 16 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Jason Telisch wrote:
I read and reread the PHP manual about sessions, and I have a quick
question. What causes the session id to change? I tried destroying the
session and unsetting the session vars, but it maintains the same id.

Just so you know, I don't need to make the session id change for any
reason. I'd just like to know what to avoid since I'm going to be storing
data the user enters with their sessionid and I'd like to make sure that
they can still access it through their entire visit.


The session id shouldn't change. It's randomly generated when the user
enters your website and is then passed back by the browser using cookies
or as part of the url on each subsequent request. This id is then used
as the key to the session variables.

Destroying the session variables simply destroys the contents of the
session. The id and the empty session will continue to exist.

Jul 16 '05 #2

P: n/a
Kevin Thorpe wrote:
Jason Telisch wrote:
I read and reread the PHP manual about sessions, and I have a quick
question. What causes the session id to change? I tried destroying
the session and unsetting the session vars, but it maintains the same id.

Just so you know, I don't need to make the session id change for any
reason. I'd just like to know what to avoid since I'm going to be
storing data the user enters with their sessionid and I'd like to make
sure that they can still access it through their entire visit.

The session id shouldn't change. It's randomly generated when the user
enters your website and is then passed back by the browser using cookies
or as part of the url on each subsequent request. This id is then used
as the key to the session variables.

Destroying the session variables simply destroys the contents of the
session. The id and the empty session will continue to exist.


So, when the client deletes the cookie, the session id will be lost. If
the client continues to visit the site, he will receive a new cookie
with a new session id.

Jul 16 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.