Skip to content. | Skip to navigation

Sections
Personal tools
You are here: Home News & views Sessions are evil

Posted Jun 04, 2008

Sessions are evil

by Erik Rose

My comprehensive, cathartic condemnation of that carbuncle on the countenance of the stateless web

Sessions are evil

This article by Erik Rose

I recently read this on Slashdot, and it threw me into a tizzy:

"Complex page state is kept on the server, in a session-associated database. If requests are...sending a lot of data every time, which isn't user-entered on that specific page, they're not very well coded."

On the contrary, session-dependent web apps are bankrupt design-wise. They violate the (stateless) page metaphor, breaking the standard UI and confusing the user, simply because some programmer couldn't be bothered to find a good way of maintaining state. Some of my favorite denizens of the Session Hall of Shame are...

In these days of >100KB page loads, it's silly to sweat over 4KB typed into a textarea. If you find it painful to maintain state from request to request programmingwise, you're not using enough framework. Find something nice that'll stow user data client-side without making you think about it. Or, if you're in the mood for something exotic, try a continuation-based framework like Seaside: those let you forget about the statelessness of HTTP altogether, though admittedly at the cost of tokens which feel a bit like session identifiers but aren't quite. (They still don't break the Back button or parallel surfing, and you can set the timeout to a week.)

What I really mourn is the passing of HyperCard for the web. There was a time back in the nineties where it looked like HyperCard was going to get rolled into QuickTime and thus be available in any browser that could run the plugin. Now that would have been sweet. I suppose Flash isn't a much different result, though I hear its roots in linear-chronology animation still poke through when trying to develop apps on it. If the Flash UI were a little better—using native widgets, letting standard text selection and copy and paste work—I'd likely be won over. I suppose the best choice today is session-free AJAX with a good framework to keep the details out of your face, like KSS does in Plone. The result isn't as good as a native app or even a HyperCard stack, but it's as good as anything else on the web: not too bad to code, accessible to the disabled, happy to work with your OS's standard facilities, and still functional if you turn JavaScript off.

Thanks for reading to the bottom of my rant! I feel much better now. :-)

Document Actions

State

Posted by Anonymous User at Jun 28, 2009 10:47 PM
As long as I know you are you, and which you it is, I hope to be able to deal with it.
VGhost
Need help now?

Immediate assistance is available during university work hours:

News & views…
Posted Oct 13, 2009 Portlets gone wild with ContentWellPortlets 2.0.1 This new release adds the ability to add portlets to the footer area. It also has 6 portlet managers per area. This means 20 total portlet managers including the 2 on the sides that ship with plone.
Posted Sep 17, 2009 Plone 4 – An interview with Zope News Jan Ulrich Hasecke interviews me for Zope News.
Posted Aug 31, 2009 Web Services API for Plone Alpha 3 Release Details the release of the wsapi4plone.core package and the plans for future releases. The final report of the AtomPub for Plone Google Summer of Code project.
Posted Aug 28, 2009 Content editing and creation in Plone is faster with archetypes.schematuning Some bench marks of content editing and creation in Plone with and without archetypes.schematuning installed.
More news & views…