Hi Guys,
Ive been doing some research on session fixation..
From what I understand...
If a hacker logs into my site ( getting a session ID ) and then somehow gets a user to visit my site with his PHPSESSID .. They will then login and they "both" be able to do the same thing.. IE: the hacker will now have their access level..
Im trying to stop this ( Albeit a small problem ).
Currently WHENEVER anyone auths or changes "permission levels"
I do this:
Code:
<?php
session_start(); // Start the Session
session_destroy(); // Destroy it..
session_start(); // Start a new one.
session_regenerate_id(); // regen the ID.
?>
Now,
With this im assuming that this can stop any kind of fixation hack?
The hacker will have one ID, Then if they try and get a user to use their ID.
It will fail because a new session with a new ID has been forced?
Am I thinking about this right?
Ive read a lot of documents and as far as I can tell, This would fix my issue. ( albeit a tiny issue )
Any thoughts?
|