Hi all,
How to clear the session ?
- Gnaniyar Zubair
Hi all,
How to clear the session ?
A session, in web terms, is a bunch of data stored on the server that is associated with an identifier that is stored on the client (usually, but not always, in a cookie) and sent back to the server with every request.
It is a very generic term, and how you clear it depends on the specific implementation of the session concept.
From JavaScript, short of using Ajax, the most you are likely to be able to achieve is to wipe out the token on the client so it can't access the session any more (the session will then expire as normal - since all session implementations have to have an expiry time to stop them hanging around forever).
What session are you talking about? Do you mean the session a browser holds from its open to close state or do you mean some kind of server-side state in some platform like asp, php, asp.net...? Also a cookie could be session persistent, in that case you just kill it (send it to the browser again with an expire date that is in the past)
You should describe your problem further, making it possible to give you the correct answer ;)
In most cases (server side) sessions require a session id in either a cookie or get parameter, so just remove either one to destroy that "session". Otherwise, if you know how to destroy the session in your server side language, just create a page for that and call it using a XMLHttpRequest.