Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer

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 the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (7)
As of 2016-06-28 22:38 GMT
Find Nodes?
    Voting Booth?
    My preferred method of making French fries (chips) is in a ...

    Results (364 votes). Check out past polls.