The PHP Scalability Myth
Subject:   Hidden variables for session state?
Date:   2003-10-18 01:53:17
From:   anonymous2
Response to: Hidden variables for session state?

No - if you read again: hidden variables for View state, not Session state.

Put simply how to preserve the state of a complex form, while dealing with validation, perhaps a form of multiple pages (e.g. flight booking).

>>> The hidden fields are used prior to validation. <<<

If you're keeping this information in memory or some kind of session store between requests, you're doing things badly wrong and will end up with a) alot of junk in memory for users that didnt come back and b) a whole load of extra processing as you have to re-validate the data on every request until the form is finally complete and c) a whole load of extra complexity in your code to deal with.

Jeez - this is basic stuff that people learnt with CGI ten years ago.

Main Topics Oldest First

Showing messages 1 through 1 of 1.

  • Hidden variables for session state?
    2004-07-06 05:53:54  teejay [View]

    So why not use a cookie instead?

    or better still, do the right thing and use a shared database for sessions.

    If we are talking about decent scaling and reliability, then you want session and state info to be kept at the server to save on a) passing it all back and forth and b) validating it all.

    On any UNIX system it is trivial to store the information in a DB that is shared between multiple webservers. There are lots of ways of making that kind of thing scale to very high levels.

    Hidden variables are a sign that you haven't finished designing your application