[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 308
  • Last Modified:

remember state using cookies

I'm really rookies in web development, I'm using this script and it works great

http://www.dynamicdrive.com/dynamicindex1/navigate2.htm

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
jiri
0
playernovis
Asked:
playernovis
2 Solutions
 
pigmentartsCommented:
to do this yes you will need to use cookies. a useful link here: http://www.quirksmode.org/js/cookies.html
0
 
playernovisAuthor Commented:
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
jiri
0
 
playernovisAuthor Commented:
it looks like the script is using cookies, but only session cookies. Can I easily change it to persistent cookies?

0
 
LeeKowalkowskiCommented:
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.

--
Lee
0
 
Computer101Commented:
Forced accept.

Computer101
EE Admin
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now