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

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

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

 



hpg4815
Novice

May 18, 2016, 6:08 PM

Post #1 of 2 (1378 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 http://search.cpan.org/~isaac/libapreq2-2.13/glue/perl/lib/Apache2/Cookie.pm#name , 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.

#!/opt/cloudhost/perl5/perls/perl-5.10.1/bin/perl

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/auth4.pl line 12.\n


Zhris
Enthusiast

May 21, 2016, 4:25 PM

Post #2 of 2 (1344 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.


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


Chris

 
 


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

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