|Just another Perl shrine
Re: mod_perl and multiuser global variablesby maverick (Curate)
|on Dec 05, 2005 at 15:31 UTC
Try looking at Apache::Session in tandem with Apache::Cookie. The former sets up a hash that can be used to store any user specific data and retrive it in subsequent requests by referencing a unique key. The later helps you manage cookies that can be used to store your unique session key on the browser side.
The problem that you're running into isn't really one of keeping a value shared, it's one of making sure you have the same value for the same browser session. Since HTTP is stateless, you have to have the browser pass back to the server on each request (either via cookie or URL parameter) the unique identifier of the session.
It's Monday AM...let's see if I can whip out a working example.
Hope this helps
Edit: Typos, add links to cpan