Reset a Session ID.

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
hawleyjr
BeerMod
Posts: 2170
Joined: Tue Jan 13, 2004 4:58 pm
Location: Jax FL & Spokane WA USA

Reset a Session ID.

Post by hawleyjr »

I am trying to reset a session id. My thoughts were to do the following:

Code: Select all

session_unset();
	session_start();
	echo session_id().'-->1<BR>';

	session_unset();
	session_start();
	echo session_id().'-->2<BR>';
	
	session_unset();
	session_start();
	echo session_id().'-->3<BR>';
However, the output looks like this:

Code: Select all

49b4d982aefe4a291e5a9d0815987a0c--&gt;1
49b4d982aefe4a291e5a9d0815987a0c--&gt;2
49b4d982aefe4a291e5a9d0815987a0c--&gt;3
?&gt;
I am more or less just tinkering around; but if anyone else has successfully reset the session id without forcing the user to close the browser. I'd be interested to see how.
User avatar
Weirdan
Moderator
Posts: 5978
Joined: Mon Nov 03, 2003 6:13 pm
Location: Odessa, Ukraine

Post by Weirdan »

[php_man]session_regenerate_id[/php_man]()
Post Reply