Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

cookie AND redirect...

by powerhouse (Friar)
on Feb 05, 2003 at 00:37 UTC ( #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

Comment on cookie AND redirect...
•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
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? | Other CB clients
Other Users?
Others romping around the Monastery: (5)
As of 2014-07-29 02:51 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (211 votes), past polls