Beefy Boxes and Bandwidth Generously Provided by pair Networks Joe
Think about Loose Coupling
 
PerlMonks  

Re: cookies and redirecting

by Anonymous Monk
on Jun 18, 2001 at 20:57 UTC ( [id://89445]=note: print w/replies, xml ) Need Help??

This is an archived low-energy page for bots and other anonmyous visitors. Please sign up if you are a human and want to interact.


in reply to cookies and redirecting

here is the code am using now but it is still not doing right.

if(my $cryptpass = Intranet::Security::Authenicate($args{'username +'},$args{'password'})) { my $co = new CGI; my $cookie = Intranet::Security::CreateUserCookie($args{'usern +ame'},$cryptpass) || die " Could not create cookie"; print $co->header( -uri=>'/maddenapps/test.cgi', -cookie=>$coo +kie); exit; }

Replies are listed 'Best First'.
(Ovid) Re: Re: cookies and redirecting
by Ovid (Cardinal) on Jun 18, 2001 at 21:03 UTC
    s/header/redirect/;
      i did do that, and redirect with out setting the cookie. Could the problem i am doing this on IIS?

        IIS versions 3, 4, and 5 have a bug that causes them to ignore the cookie header on a redirect. You'll need to use a non-parsed header (NPH) script or find an alternative.

        print $query->redirect( -uri => 'http://www.perlmonks.org/', -cookie => $cookie, -nph => 1 );

        If I recall correctly, the way to get IIS to recognize the script as NPH is to prepend 'nph-' (without the quotes) to the script name. In other words, 'myscript.cgi' becomes 'nph-myscript.cgi'.

        Cheers,
        Ovid

        Join the Perlmonks Setiathome Group or just click on the the link and check out our stats.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://89445]
help
Sections?
Information?
Find Nodes?
Leftovers?
    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.