Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

cookie AND redirect...

by powerhouse (Friar)
on Feb 05, 2003 at 00:37 UTC ( [id://232692]=perlquestion: print w/replies, xml ) Need Help??

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

Is it possible to print a Cookie AND then redirect the user using the CGI.pm redirect clause?


According to the documentation I found, it says if I want to redirect then I should NOT print any headers. So, I don't know how I should do it.

Any Ideas?

thx,
Richard

Replies are listed 'Best First'.
•Re: cookie AND redirect...
by merlyn (Sage) on Feb 05, 2003 at 00:47 UTC
      Thanks, and BTW, this cookies only data is an affiliate code so that the person responisble for them finding our site gets credit.

      I don't use cookies for anything but that, and maintaining a sessionid, then we store anything we need(user stuff) in a database, they can expire it at anytime by clicking a link in their personal profile page. FYI. :o)

      Richard.
Re: cookie AND redirect...
by giulienk (Curate) on Feb 05, 2003 at 08:26 UTC
    use CGI qw(:standard); #do everything print redirect( -url => $redirect_url, -cookie => cookie( -name => 'WHATEVER', -value => 'see_NB' ) );
    NB: check merlyn's previous reply (and article) for a good policy about what should go and what shouldn't go in cookies.


    $|=$_="1g2i1u1l2i4e2n0k",map{print"\7",chop;select$,,$,,$,,$_/7}m{..}g

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others having an uproarious good time at the Monastery: (6)
As of 2024-03-19 02:41 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found