Maintaining state

Hi, I have PHP and javascript. I have a nice DHTML page I made for a menu thingy, that has a number of links that can be shown/hidden.  When the user returns to the page it is reloaded from the server and rebuilt.  But I would like the users to be able to return to it in the state they left it.  The thingy has lots of hide/show sections. I guess I could get javascript to send a record of all the show states to the server as GET parameters, or maybe even POST an array of thingy states along when a link is selected - so the server could recreate it in the same state.  But what I was wondering is whether I can get javascript to keep and update the show states client-side between pages, somehow, and reload them?  Would a cookie allow this?
LVL 2
kaller2Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

pjedmondCommented:
Yes - cookies are probably the way to go, BUT, some people disable cookies, so this process cannot be reliedon:(

He is a link on how to to set/reset/read cookies:

http://blazonry.com/javascript/cookies.php


HTH:)
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
James RodgersWeb Applications DeveloperCommented:
0
jaysolomonCommented:
If your using php, then i would forget the cookies all together
and set a var on the server some how when a menu is expanded and when it is closed.

or
just use either hidden form fields, and onload have an init function to read the hidden field value(s) and then show or hide the menu(s)  

or

You could pass a query string thru the link and use php to read the query str and set your menu up like that, or use location.search in javascript to read it.
0
kaller2Author Commented:
Yes I have heard these urban myths that some people turn off cookies, but I have yet to meet one of these mythical beings that programming folk legends thrive apon.  I imagine they eat their meat raw and light fire by rubbing sticks together.  Tales of latterday luddites?  Lump these with the half a dozen users world wide using Netscape 3 no doubt?  And thin client ?  It is not always a good idea to hammer the pipe to the server when you have a gazillion megaflops lying idle on the users desktop?  Idle that is apart from the mis-application of enormous computing power to the simple problem being an operating system, with a propensity to fail.  And generate endless pseudo support teaser messages - these must be the same half wits who press the "send" button ;)

Seriously tho many thanks for the cookie refs, reading now...
0
jaysolomonCommented:
No comment has been added lately, so it's time to clean up this TA.
I will leave the following recommendation for this question in the Cleanup topic area:

Split: pjedmond {http:#9923847} & Jester_48 {http:#9923927}

Please leave any comments here within the next four days.
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

jAy
EE Cleanup Volunteer
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
JavaScript

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.