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:


<FilesMatch "\.(html)$">
*        SetHandler  perl-script
       PerlHandler CAS::SSO
*</FilesMatch>

and NOT if I use the following:

<FilesMatch "\.(jsp)$">*
       PerlAccessHandler CAS::SSO
* ErrorDocument 403 http://cas.gce2000.com/SecurityServices/JSP/SSOReLogin.jsp
</FilesMatch>

or this:

<FilesMatch "\.(jsp|class)$">
*    AuthName realm
   AuthType Basic
   PerlAuthenHandler CAS::SSO
   Require valid-user
*</FilesMatch>

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


Reply via email to