CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
Search Posts SEARCH
Who's Online WHO'S
Log in LOG

Home: Perl Programming Help: Beginner:
Apache2::Cookie with SSO



May 18, 2016, 6:08 PM

Post #1 of 2 (1625 views)
Apache2::Cookie with SSO Can't Post

HI, My company uses Ping Federation (UID) to authenticate users. All the cookies and header data is created. Basically I want to harness the already generated header/cookie data by UID, and use that in the pre-existing application. I tried to do the bare minum by using Perl's Apache2::Cookie module to obtain the header and cookie info from SSO. So I tried to put together this small script just. I realize I didn't get to the point of trying to echo/print out the array of header information, but it just results in the error I mentioned below. This is frustrating to me, because based on the cpan docs , what I have should in theory work. Am I completely off here? Should I be using a different module? Any thoughts on this would be greatly appreciated.


use Apache2::Cookie;
use Apache2::Request;
use strict;
use warnings;
use diagnostics;

my $r;

my $j = Apache2::Cookie->new($r);
my @c_in = $j->cookies();

print "Content-type: text/html\n\n";

[error] Can't call method "cookies" on an undefined value at /opt/cloudhost/apache/www/html/testing/ line 12.\n


May 21, 2016, 4:25 PM

Post #2 of 2 (1591 views)
Re: [hpg4815] Apache2::Cookie with SSO [In reply to] Can't Post

You appear to be attempting to instantiate a cookie, not a jar. $j is undefined because Apache2::Cookie::new returns undefined if no name or value attribute was supplied.

my $j = Apache2::Cookie->new($r); 
my $j = Apache2::Cookie::Jar->new($r);



Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives