remember state using cookies

Posted on 2007-07-29
Last Modified: 2010-05-18
I'm really rookies in web development, I'm using this script and it works great

I would like  to remember state of opened and collapsed windows when uses close browser (all my users use IE). Simply when user comes back two days later to the same page, he/she gets opened and closed headers as he/she had it 2 days ago.

Can I use cookies for this? If yes, can somebody show me samples?? How do I have to change the samples above?

thanks a lot
Question by:playernovis
    LVL 12

    Accepted Solution

    to do this yes you will need to use cookies. a useful link here:
    LVL 1

    Author Comment

    Again, I really never used javascript. Can you please help me with my code. The site you provided is very generic cookie learning site.

    thank you
    LVL 1

    Author Comment

    it looks like the script is using cookies, but only session cookies. Can I easily change it to persistent cookies?

    LVL 16

    Assisted Solution

    The difference between session cookies and persistent cookies is that persistent cookies have an expiry date set.  So you need to use the expires parameter to create a persistent cookie.  

    They cannot persist forever, most people tend to have them persist for quite a long period (3 months -> 1 year), but extend this every time the cookie is actually used.

    LVL 1

    Expert Comment

    Forced accept.

    EE Admin

    Featured Post

    What Should I Do With This Threat Intelligence?

    Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

    Join & Write a Comment

    This article is meant to give a basic understanding of how to use R Sweave as a way to merge LaTeX and R code seamlessly into one presentable document.
    Read about why website design really matters in today's demanding market.
    Learn the basics of while and for loops in Python.  while loops are used for testing while, or until, a condition is met: The structure of a while loop is as follows:     while <condition>:         do something         repeate: The break statement m…
    Any person in technology especially those working for big companies should at least know about the basics of web accessibility. Believe it or not there are even laws in place that require businesses to provide such means for the disabled and aging p…

    729 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    18 Experts available now in Live!

    Get 1:1 Help Now