How to invalidate a session on page refresh. What I mean is, when the user refreshes a web page, session will be invalidated and redirect to another page. How to do this.
Four answers:
deepak
2013-10-02 23:37:17 UTC
Hi,
You can use the code:
session_destroy();
Read more at http://www.roseindia.net/answers/viewqa/PHP/13971-How-to-destory-session-in-PHP.html
Thanks
2013-10-02 23:27:41 UTC
Each time a request is made, I'd like to reset the countdown before the session invalidates, but I'm not sure how to do this efficiently.
2013-10-02 23:26:24 UTC
It is likely still believing you are "logged in" (active session) due to caching, whether in the browser or in the host/proxy etc.If you refresh after hitting back does it still see the session? (Assuming of course the page you click back to does not refresh the session, if it does remove/disable that code.)