Posted By

alvaroisorna on 05/13/08


Tagged

javascript session cookies


Versions (?)


Advertising

Website Promotion DIRECTORY is a crucial factor for all websites that need to gain better organic search engine rankings and increase website traffic.
Submitting your website as part of your Web Promotion strategy to our SEO friendly and high traffic Business Directory for review is an excellent way to gain a valuable backlink and increase your websites visibility online.

Submit Site


Who likes this?

1 person has marked this snippet as a favorite

noah


Session variables without cookies


Published in: JavaScript 






URL: http://www.thomasfrank.se/sessionvars.html

"I never liked the JavaScript implementation of cookies. The storage space is limited (4 x 20 Kb per domain), the only data format that can be used is a string and the syntax for setting and getting cookies is unnecessarily complicated. On top of that they get added to the browser request header - and since a lot of corporate firewalls only accept a rather limited request header length they might prevent your pages from loading at all. (I've seen it happen - it's ugly.) So I've made a small script that let you use JavaScript session variables without using cookies. It will let you store 2 MB of data, with much less hassle than a cookie based solution."

Expand | Embed | Plain Text
  1. <head>
  2. <script type="text/javascript" src="sessionvars.js"></script>
  3. ...
  4. </head>

Report this snippet 

Comments

RSS Icon Subscribe to comments
Posted By: ischenkodv on May 18, 2008

Very good script, but unfortunately session data are not restored if user opens anything in new window/tab.

You need to login to post a comment.

Download royalty free graphics