Gossamer Forum
Home : General : Perl Programming :

CGI::Session::Auth reading cookie proble

Quote Reply
CGI::Session::Auth reading cookie proble
Hi seniors.

I have testing the CGI::Session::Auth , however i found every time, i refresh the page
the script create a new cookie after i logined (authentication is ok).
the problem seems that script is not reading existing cookie properly so treat me as an
new visit and create a new cookie every time.

I wonder if any one could point me the problem?


#!/usr/bin/perl
# this is an test
use CGI;
use CGI::Session;
use CGI::Session::Auth::DBI;

# CGI object for headers, cookies, etc.
my $cgi = new CGI;
# CGI::Session object for session handling
my $session = new CGI::Session(undef, $cgi, {Directory=>'i:/tmp'});
#my $session = new CGI::Session(undef, $self->query, {Directory=>'/tmp'});

# CGI::Session::Auth object for authentication
my $auth = new CGI::Session::Auth::DBI({
CGI => $cgi,
Session => $session,
DSN => "dbi:mysql:host=localhost;database=testdb",
DBUser => "DBUser", ########
DBPasswd => "DBPasswd", ########
#DoIPAuth => 1
});



$auth->authenticate();

# check if visitor has already logged in
if ($auth->loggedIn) {

&showSecretPage;
}
else {
&showLoginPage;
}
Subject Author Views Date
Thread CGI::Session::Auth reading cookie proble courierb 27438 Dec 24, 2005, 11:32 PM
Thread Re: [courierb] CGI::Session::Auth reading cookie proble
Chaz 27151 Dec 25, 2005, 7:41 PM
Thread Re: [Chaz] CGI::Session::Auth reading cookie proble
courierb 27231 Dec 25, 2005, 11:02 PM
Post Re: [courierb] CGI::Session::Auth reading cookie proble
Chaz 27180 Dec 25, 2005, 11:06 PM
Thread Re: [courierb] CGI::Session::Auth reading cookie proble
courierb 27160 Dec 25, 2005, 11:09 PM
Thread Re: [courierb] CGI::Session::Auth reading cookie proble
Chaz 27113 Dec 26, 2005, 9:13 PM
Thread Re: [Chaz] CGI::Session::Auth reading cookie proble
courierb 27167 Dec 26, 2005, 11:10 PM
Thread Re: [courierb] CGI::Session::Auth reading cookie proble
Chaz 27140 Dec 27, 2005, 6:48 AM
Thread Re: [Chaz] CGI::Session::Auth reading cookie proble
courierb 27137 Dec 28, 2005, 2:31 AM
Thread Re: [courierb] CGI::Session::Auth reading cookie proble
courierb 27013 Jan 11, 2006, 11:17 AM
Thread Re: [courierb] CGI::Session::Auth reading cookie proble
courierb 26991 Jan 11, 2006, 10:54 PM
Thread Post deleted by courierb
courierb 27003 Jan 11, 2006, 11:06 PM
Thread Re: [courierb] CGI::Session::Auth reading cookie proble
courierb 26990 Jan 11, 2006, 11:09 PM
Post Re: [courierb] CGI::Session::Auth reading cookie proble
courierb 26987 Jan 12, 2006, 9:37 AM