Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses

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
[Corion]: Hi jedikaiti!
[Cosmic37]: is there a webpage for full CB for this chat rather than side panel chat?
[Cosmic37]: thank you for advice
[Cosmic37]: peach greets jedi
[Cosmic37]: ok this one works better fullpage chat
[Cosmic37]: test
[Cosmic37]: sort of anyway... hurls some peaches... :-D

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (9)
As of 2017-06-29 16:24 GMT
Find Nodes?
    Voting Booth?
    How many monitors do you use while coding?

    Results (672 votes). Check out past polls.