How can I delete the session information from my browser by using javascript? Is it possible to do?
Session information is usually stored on the server. An HTTP request to a page that destroys the session would normally do the trick (using AJAX if you wish).
For cookies you can set the cookie expiry date to the current date, this will expire the cookie and remove it.
var d = new Date();
document.cookie = "cookiename=1;expires=" + d.toGMTString() + ";" + ";";
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With