Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

cookies and redirecting

by outcast (Monk)
on Jun 18, 2001 at 23:33 UTC ( [id://89413]=perlquestion: print w/replies, xml ) Need Help??

outcast has asked for the wisdom of the Perl Monks concerning the following question:

i am having a problem. I am setting a cookie then trying to redirect a user using the CGI module. I believe the headers for the cookie are messing up the header for the redirect. Any thoughts?

Replies are listed 'Best First'.
(Ovid) Re: cookies and redirecting
by Ovid (Cardinal) on Jun 18, 2001 at 23:46 UTC

    If you do not post the relevant code, there is little we can do. If you've created the cookie, here's the syntax:</code>

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

    Don't print any headers before that. Provide us the following:

    • Relevant code (between <CODE> tags)
    • Web server
    • OS
    • Perl version number

    The problem will probably be easy to spot if you provide us with just the first two items from list.

    Cheers,
    Ovid

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

      thanks, your info was help full. next time i will post the code.
Re: cookies and redirecting
by Anonymous Monk on Jun 19, 2001 at 00:57 UTC
    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; }
      s/header/redirect/;
        i did do that, and redirect with out setting the cookie. Could the problem i am doing this on IIS?

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://89413]
Approved by root
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others about the Monastery: (2)
As of 2025-03-20 01:52 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    When you first encountered Perl, which feature amazed you the most?










    Results (60 votes). Check out past polls.