title: login and logout of sessions in 2 cgi scripts
body: <p>I need to store a login session when the user is login and remove the login session when the user has logged out of the system or the session has timeout. I am coding in Perl. I know I can use CGI::Session module in Perl but how do I make sure that the session is created by 1 cgi script and removed by another cgi script. Then all other pages of the system has to check if the session exist before it can display its contents.</p>
  
  <p>Currently, I am using the following code to create a new session when the user has login successfully.</p>
  
  <pre><code>my $session = CGI::Session-&gt;new();
  my $CGISESSID = $session-&gt;id();
  </code></pre>
  
  <p>However, how do I log the user out of the session in another cgi script? I doubt I can just use the following since the $session is not defined in the other cgi script</p>
  
  <pre><code>$session-&gt;delete();
  $session-&gt;flush();
  </code></pre>
  
  <p>Any ideas?</p>