Posts: 255
Name: John Nerush
Location: Milton Keynes, UK
|
Sorry Chris, didnt explain my thoughts properly.
What ive done is approach the challenge from a different angle, obviously we cant execute any php once the user leaves becasue the user no longer has any interaction with the scripts. Additionally PHP cant detect that the user has navigated away, it just stops functioning, we know this
What I am trying to think of is working the problem from the oposit direction, we cant tell the user has left the site but we do know when i user is on the site.
We can also detect where the user has come from. So, using this information can we not tell the page to clear the session if the user has navigated to said page from anywhere other than a list of safe pages/sites (if any) etc.
The possible problems with this that I can see (im sure there are more, and im sure you will be kind enough to explain them);
If a user leaves the site, presses back a few times, would this become insecure?
Does using $_SERVER open the possibility of other security issues?
Brain wave (Thinking out loud):
Would a possible solution be using a hidden form/post/get request using a unix time stamp tied to the session creation, i.e. that session is only valid for that page and cant be used after the timestamp?
dgkindy,
Maybe if you explain the context of what your trying to use this on it will spark an idear.
|