Sessionless Sessions

A little while ago I mentioned in a post on the PHP-General mailing list that I’d implemented a way to persist data between page requests without requiring server-side storage. This raised a number of questions which I answered without giving too much away.

A few weeks later Jochem Maas asked for a more detailed explanation. I had already started writing an article for this site explaining the details but since it’s a low priority I hadn’t finished it yet. I have now.

Sessionless Sessions is a somewhat confusing title but I hope I’ve explained what I mean clearly within the article As always comments are welcome.

Mar 11th, 2008 | Posted in Misc
Tags: ,
  1. Apr 2nd, 2008 at 17:52 | #1

    Thanks for this article.
    Can’t you just store sessions in mysql DB and solve all issues caused by file-based sessions?

  2. Apr 9th, 2008 at 21:15 | #2

    Yes you can but on high-traffic applications this can lead to database requests that aren’t necessary which will eventually lead to further scaling issues. Essentially you’re just shifting and delaying the problem.

    Also consider that when using traditional sessions you’re probably reading the session data on every request even if you won’t be using/updating it. In the article I described a method of securely storing a limited amount of data between page requests that requires very little extra processing per request and does not involve server-side storage thus eliminating any scaling issues.

    Thanks for your comment and I’m glad you enjoyed the article.

Leave a comment

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>