Urgent---Change 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
renu
Forum Commoner
Posts: 30
Joined: Sat Nov 06, 2004 12:20 am

Urgent---Change session_id

Post by renu »

Hi

I have changed session_id to a new one.on that page it gets change.but as i move to another page this id is not new one.
In short i want to change session_id.

Plz help me out.

Thanks
User avatar
mudkicker
Forum Contributor
Posts: 479
Joined: Wed Jul 09, 2003 6:11 pm
Location: Istanbul, TR
Contact:

Post by mudkicker »

from manual:
When defining your own unique session ID instead of letting your browser do the job, you should do this before starting the session
e.g.
$id = 143445254;
session_id($id);
session_start();
print session_id();
// prints 143445254
//instead of the 32-bit string //generated by
//the computer/browser
//ofcourse it is better if you'll //generate your own session ID using md5
renu
Forum Commoner
Posts: 30
Joined: Sat Nov 06, 2004 12:20 am

Post by renu »

hi
that can be a solution.but now this stage i want to change the session id.can someone help me out
thanks
timvw
DevNet Master
Posts: 4897
Joined: Mon Jan 19, 2004 11:11 pm
Location: Leuven, Belgium

Post by timvw »

session_regenerate_id();
renu
Forum Commoner
Posts: 30
Joined: Sat Nov 06, 2004 12:20 am

Post by renu »

But that just works for php version 4.2. But we are using version less than that.so wht should i do
Post Reply