Think of it this way... when user A sends requests a web page, a custom web page is constructed for user A, and sent back to user A. No one, no one in the world, in fact, not even user A using another browser on the same computer, gets that first page. Only user A, within the browser from which user A requested the page, only that user gets that page. That connection, between that instance of the browser and the web server, that connection is a session, and that session lasts only for the duration of that connection.
Thanks for the above. It's indeed very clear and reassuring that this part wouldn't result in user B seeing user A's page.

I do indeed use CGI::Session. Now I'm wondering if I might be messing things up by declaring the session variable ($session) as a global:
package Common; use strict; use CGI::Session; require Exporter; our @ISA = qw(Exporter); our @EXPORT = qw($session); our $session; 1; package Login, use Common qw($session); $session = new CGI::Session('driver:File', undef, { Directory=>'/sessi +ons' }); # $self holds user information passed from another sub $session->param('USER', { username => $self->{username}, last_logged => $self->{last_logged}, } $session->flush; print $session->header(-location=>"/index.pl"); 1; # index.pl use Common qw($session); use Main.pm use Login.pm $session = CGI::Session->load("driver:File", undef, { Directory=>'/ses +sions' }); my $query = get_param('page') || 'main'; #probe($query); my %nodes = ( main => \&main, login => \&login, _err => \&error, ); eval { $nodes{ exists $nodes{$query} ? $query : '_err' }(); }; package Main, use Common qw($session); # the same $session is used in this module 1;
The $session object is created when the user logs in and is loaded only via index.pl and used in other modules (called via index.pl) requiring it. Any risk of this variable being corrupted when there are multiple users?

Please enlighten me :)

In reply to Re^8: HTML Template by Anonymous Monk
in thread HTML Template by Anonymous Monk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.