we all know that we can set and get session using javascript like below:
session.setItem("name", "value");
session.getItem("name");
I need to know how to destroy particular and all session variable in javascript.
I used google but I'm unable to get exactly what I need. Please help me to find the solution. jQuery answers are also welcome (without plugin)
Thank you in advance
I assume this is session storage in html5, in which case you can use
sessionStorage.clear();
to remove all items in the session storage or
sessionStorage.removeItem('itemName');
to remove a specific item.
clear(void):void This public method remove everything from the sessionStorage object.
https://code.google.com/p/sessionstorage/
I didn't test my self but I think it should work.
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