Re: Lisp Web Development and Application State
- From: "mrcsparker@xxxxxxxxx" <mrcsparker@xxxxxxxxx>
- Date: 3 Sep 2006 08:14:32 -0700
Hidden variables in the HTML forms, that is, <INPUT TYPE="hidden"
NAME="state" VALUE="8NM83gdUrqI8TsHe"> or similar. These provide
the hook for you to map back to wherever on the server you stored
the full state [whether in memory or an SQL database or whatever],
as I showed previously.[3]
In the limit, this can extend so far as to store *all* of the state
in the displayed pages, which has the distinct advantage of not
needing to handle any timeouts on session state on the server,
as well as allowing pages to be "restarted" even after having been
saved to the user's local disk(!) [but in that case you will probably
want to store a cryptographically-secure hash with the state to avoid
modify/replay attacks.
ASP.net does this, and I never thought all of the reasons why they went
with this method. At first, I thought, why not just store the data in
a session or hack together a continuations/closures system that stores
the data on the server. Sessions are great, but not for my particular
problem which is multi-page forms where the user might walk away for an
hour to get more information.
There are also all sorts of other cool little things that can be done
with storing data in a hidden variable:
- Save the "state" to a single session variable for small forms.
- Write the "state" to the database in a single field. Also, just save
parts of the state to a field.
- Write out the "state" easily to a file.
- The reasons you pointed out.
The database structure of the application is very, very abstract so
that I can create new forms on the fly without having to create new
tables.
Thanks for the well-thought-out response.
Chris
.
- References:
- Lisp Web Development and Application State
- From: mrcsparker@xxxxxxxxx
- Re: Lisp Web Development and Application State
- From: Rob Warnock
- Lisp Web Development and Application State
- Prev by Date: Re: How to add a feature to *features* ?
- Next by Date: Re: Any Lisp financial success stories since Naughty Dog?
- Previous by thread: Re: Lisp Web Development and Application State
- Next by thread: Re: Lisp Web Development and Application State
- Index(es):
Relevant Pages
|
Loading