JavaScript: Cookie-less Session Data


Sometimes you need to be able to pass data between pages using JavaScript. For this, you can use cookies with all the limitations associated to them or you can use a nasty trick. The variable will survive between page loads, so, if you write something into this variable, it will be available after a page reload 🙂 . Of course you can’t use this for sophisticated or secure data, but for temporary parameters it’s OK.

Example = "This message will survive between page loads";

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s