[26105] in Perl-Users-Digest

home help back first fref pref prev next nref lref last post

Perl-Users Digest, Issue: 8302 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Aug 3 21:05:33 2005

Date: Wed, 3 Aug 2005 18:05:07 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Wed, 3 Aug 2005     Volume: 10 Number: 8302

Today's topics:
        Problem with CGI::Sessions in Linux <davezx1@yahoo.com>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

----------------------------------------------------------------------

Date: Wed, 3 Aug 2005 19:31:28 -0400
From: "David Staschover" <davezx1@yahoo.com>
Subject: Problem with CGI::Sessions in Linux
Message-Id: <mrcIe.1192$9v3.92@fe09.lga>

Hi,

I'm trying to set up sessions in perl.

The session is initialized fine in session1.cgi

In session2.cgi, the correct session id is returned from the cookie, but 
when I initialize the session, a new session is created.

Any help would be appreciated!

- David

session1.cgi:
#!/usr/bin/perl
use CGI::Session;
use CGI;
$cgi = new CGI;
$session = new CGI::Session(undef,undef,{Directory=>'/tmp/sessions'});
$cookie = $cgi->cookie(CGISESSID => $session->id);
print $cgi->header( -cookie=>$cookie );
$sid=$session->id;
print "Session ID is $sid<br>";
print '<a href="session2.cgi">Link to session2.cgi</a>';
exit;

session2.cgi
#!/usr/bin/perl
print "Content-type: text/html\n\n";
use CGI::Session;
use CGI;
$cgi = new CGI;
$sid=$cgi->cookie("CGISESSID");
$session = new CGI::Session(undef,$sid,{Directory=>'/tmp/sessions'});
print "Original Session ID is $sid<br>";
$sid = $session->id();
print "New Session ID $sid<br>";
exit;




------------------------------

Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 6 Apr 01)
Message-Id: <null>


Administrivia:

#The Perl-Users Digest is a retransmission of the USENET newsgroup
#comp.lang.perl.misc.  For subscription or unsubscription requests, send
#the single line:
#
#	subscribe perl-users
#or:
#	unsubscribe perl-users
#
#to almanac@ruby.oce.orst.edu.  

NOTE: due to the current flood of worm email banging on ruby, the smtp
server on ruby has been shut off until further notice. 

To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.

#To request back copies (available for a week or so), send your request
#to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
#where x is the volume number and y is the issue number.

#For other requests pertaining to the digest, send mail to
#perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
#sending perl questions to the -request address, I don't have time to
#answer them even if I did know the answer.


------------------------------
End of Perl-Users Digest V10 Issue 8302
***************************************


home help back first fref pref prev next nref lref last post