Closing a session and opening a new one
Posted on 2004-04-28
In my script I am making sure the user is authentic by storing their IP address in the session when it's created and checking it against their IP address on each page subsequently. The reason for this is to stop people passing along a URL to a friend with the session ID and that friend getting access to their information (I cannot use cookie sessions).
The problem is this. If the IP addresses don't match up I want to create a new seperate session for this different user. There doesn't seem to be an easy way to do this, in essence what I need is a session_stop() function so I can genereate my own ID set it with session_id() then run session_start() again to create the new session.