Re: Session variables

by "Michael Gerholdt" <gerholdt(at)fredonia.edu>

 Date:  Sat, 23 Dec 2000 00:14:54 -0500
 To:  "Cyanide _7" <leo7278(at)hotmail.com>,
<hwg-languages(at)hwg.org>,
"Susan Walsh" <susan(at)equilibriumdesign.com>
 References:  hotmail
  todo: View Thread, Original
> my only question now for the list... is it more practicle to just use a
> session cookie here? i've heard a lot of talk as to how these hurt server
> performance, so would a cookie be better? - Cyanide_7
>

More than one way to skin the cat.
Sessions, cookies both problematic in some way.
what if cookies are disabled?
So - create session/stateful-like features by passing all the values you
wish to persist as hidden form items
Or write them to a database and always retrieve

In this (Susan's) case, it looks like many of the values are already in a
database and these are being written into session object

Which is going from one way of storing/retrieving data to another

why not just stick with db (using a db is maybe a little slower but it has
the strengths of being very solid/reliable and you can release resources
after doing the query which is not the case with session)

and combine that with passing hidden values in forms

that's what I do most of the time. as long as you can hand off key
identifying variables from page to page via hidden fields, then query the db
anytime you need  more.

(In some cases when it is important to store information temporarily but
very solidly and without confusion, a temporary table is the answer, which
you can then drop at end of session or earlier when that data need is over)

Let me know if I'm not making sense!

Mike

HWG: hwg-languages mailing list archives, maintained by Webmasters @ IWA