To Store a variable value in a session

75 pts.
Tags:
JavaScript
Web development
Hi , I would like to know, is it possible to store a variable value in a Session on client side using Javascript. I need to store it that value for a period of 24 hours. Please let me know abou this. Some sample code will definetly helphttps://itknowledgeexchange.techtarget.com/faq#tags
1

Answer Wiki

Thanks. We'll let you know when a new response is added.

You have to use cookies. You can set the expiration date of the cookie to be 24 hours. The value of the cookie would be the variable you need to store.

Here’s a site I found through search which contains some decent functions to set, get, and delete cookies:
http://www.developertutorials.com/tutorials/javascript/custom-javascript-functions-060822/page9.html

Discuss This Question:  

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

Thanks! We'll email you when relevant content is added and updated.

Following

Share this item with your network: