I’m trying to redirect the user to another page width:
window.location.href = "url here" //relative link
but when I do, it clears my sessvars.keyPageArray variable. Anyone know how to keep a session variable after a redirect?
This is the sessvars library that I am using:
http://www.thomasfrank.se/sessionvars.html
UPDATE: I used google chrome debugger and my script actually does work. For some crazy reason it only works if I’m monitoring it variable by variable but not when I simply run it normally without the debugger on? Why is that happening?
Just because you named a variable
sessvarsdoesn’t make it so. UselocalStorage,sessionStorageor cookies depending on your need.All javascript context is unloaded and lost when the browser navigates to another page.
Example using
localStorage: