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

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 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?


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)

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.


Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://232692]
Approved by diotalevi
Front-paged by Coruscate
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (1)
As of 2018-04-26 23:56 GMT
Find Nodes?
    Voting Booth?