Re: Advice on mod_lisp-based web application.



Blaine <Blaine.M.Nelson@xxxxxxxxx> writes:

Tim, Alex, thanks for the advice. Problems vanishing does sound
nice.

I have much state in global variables, and Alex's recommendation is to
migrate those to session variables. Could you say a little more about
these, about their implementation? I'm imagining some sort of
structure that includes, along with the variable value, a session id.
This structure, while more complex than the prior global variable is
still global. Am I thinking about this correctly?

Thanks again. I really appreciate it.


Yep, you seem to be on the right track. How you implement it is really
dependent on what you need to track, but essentially some sort of structure
with some sort of 'session key'. A hash, as suggested by Alex is often a good
choice. It still has to be global because you need to be able to retrieve it
during a latter request (you could store it in a database if complex/large
enough to justify the overhead). Essentially, any value which is specific to a
user's session needs to be in this structure and used by subsequent requests.

Tim

--
tcross (at) rapttech dot com dot au
.



Relevant Pages

  • Re: global variables
    ... Global variables are pretty much the variables you shouldn't use at all if you plan on writing PHP applications that are stored in more than like three files. ... Every PHP script on a webserver is started after a request is made. ... Cookies data has "session persistence" or even "multi-visit persistence", depending on the settings in the visitor's browser and the expiration time you set for the cookie. ...
    (comp.lang.php)
  • Problem with session variables on Mac
    ... Global variables are OFF. ... I start a session at the very ... some debugging help. ... Jim Feldman ...
    (php.general)
  • Re: Looking for the simplest method to send some bytes from mirror display driver to application?
    ... "Calvin Guan" wrote in message ... Windows Network, Video, WDM Device Driver Training & Consulting ... >> variables will only be available when the session is mapped. ... when they try to access global variables that were ...
    (microsoft.public.development.device.drivers)
  • setting sessions in a form
    ... I'm just starting to use session with my forms in an attempt to lock ... down some of the less secure issues with global variables and such. ... The form process is pretty basic - a simple registration form with a ...
    (php.general)
  • Re: Kalamazoo
    ... Antiquity sessions were good. ... I missed Friday except for making an evening session ... them into the Empire. ... living, economic activity, etc. Sort of a "You're soft-selling all the ...
    (soc.history.medieval)