Return-Path: Delivered-To: apmail-perl-modperl-archive@www.apache.org Received: (qmail 75909 invoked from network); 20 Feb 2007 18:17:15 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 20 Feb 2007 18:17:15 -0000 Received: (qmail 56772 invoked by uid 500); 20 Feb 2007 18:17:18 -0000 Delivered-To: apmail-perl-modperl-archive@perl.apache.org Received: (qmail 56007 invoked by uid 500); 20 Feb 2007 18:17:15 -0000 Mailing-List: contact modperl-help@perl.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list modperl@perl.apache.org Received: (qmail 55993 invoked by uid 99); 20 Feb 2007 18:17:15 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 20 Feb 2007 10:17:15 -0800 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: local policy) Received: from [200.48.17.70] (HELO m1.aasa.com.pe) (200.48.17.70) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 20 Feb 2007 10:17:04 -0800 Received: (from root@localhost) by m1.aasa.com.pe (8.12.11.20060308/8.12.10/SuSE Linux 0.7) id l1KIDHrr001099; Tue, 20 Feb 2007 13:13:17 -0500 Received: from rcaceres.aasa.com.pe (lima92.aasa.com.pe [172.16.0.92]) by m1.aasa.com.pe (8.12.11.20060308/8.12.10/SuSE Linux 0.7) with ESMTP id l1KID3B2001035; Tue, 20 Feb 2007 13:13:13 -0500 Subject: Re: Perl Authentication Handler and Cookie Issue From: Rafael Caceres Reply-To: rcaceres@aasa.com.pe To: sshah@gce2000.com Cc: modperl@perl.apache.org In-Reply-To: <45DB2838.4080607@gce2000.com> References: <45D5E895.6090807@gce2000.com> <45D60330.6070501@aol.net> <45DB1803.1010901@gce2000.com> <45DB2838.4080607@gce2000.com> Content-Type: text/plain Organization: Corporacion Aceros Arequipa S.A. Date: Tue, 20 Feb 2007 13:24:24 -0500 Message-Id: <1171995864.4238.34.camel@rcaceres.aasa.com.pe> Mime-Version: 1.0 X-Mailer: Evolution 2.6.0 Content-Transfer-Encoding: 7bit X-Thmail: Analizado por ThMailServer para Linux. X-Virus-Checked: Checked by ClamAV on apache.org Sumit, Fetching the cookie has nothing to do with the Perl handlers. They are setting the cookie. You could check this with a small program such as: #!/point/to/your/perl -T include CGI; use vars qw{$query}; # use vars qw{$cookie}; $query = new CGI; $cookie = $query->cookie("YOUR COOKIE NAME") || ""; print $query->header(); print "cookie was:$cookie"; print $query->end_html(); Unfortunately, I'm not familiar with Java JSP, but do a search on 'java cookies' to find out how to read cookies from Java. Rafael On Tue, 2007-02-20 at 11:56 -0500, Sumit Shah wrote: > Hello, > > I did a small test to see if I can fetch the cookies without using > PerlAccessHandler and PerlAuthenHandler. I was able to fetch the cookies > using the following directive: > > > > * SetHandler perl-script > PerlHandler CAS::SSO > * > > and NOT if I use the following: > > * > PerlAccessHandler CAS::SSO > * ErrorDocument 403 > http://cas.gce2000.com/SecurityServices/JSP/SSOReLogin.jsp > > > or this: > > > * AuthName realm > AuthType Basic > PerlAuthenHandler CAS::SSO > Require valid-user > * > > I would appreciate if someone could tell me the reason for this. > > Thanks > Sumit > > Sumit Shah wrote: > > Hello, > > > > I have modified my code to handle such scenarios. But the handler > > still fails to fetch the cookies. The browser does pass the cookies. I > > can see them in IEHTTPHeaders. I would appreciate if someone could let > > me know why this could happen? > > > > Thanks > > Sumit > > > > Robert Landrum wrote: > >> Sumit Shah wrote: > >>> Hello, > >>> > >>> I have a Mod Perl authentication handler and it needs to retrieve > >>> the session id from a cookie. It is unable to retrieve any cookies > >>> and I get the following error. It does not even print any of the > >>> cookies. I would appreciate any help with this. > >>> > >>> > >>> my $token = $cookies{'SessionID'}->value; > >>> chomp($token); > >>> $log->error("3. Session ID ==> $token"); > >>> > >> > >> You're trying to call a method against a value that may or may not > >> exist. That's a big no-no. > >> > >> if(defined $cookies{'SessionID'}) { > >> $token = $cookies{'SessionID'}->value; > >> } > >> else { > >> $log->error("No SessionID cookie"); > >> } > >> > >> Rob > > > > > Analizado por ThMailServer para Linux. > > !DSPAM:45db27a5188765526914969! > Analizado por ThMailServer para Linux.