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

This node falls below the community's threshold of quality. You may see it by logging in.
  • Comment on CGI: How to retrieve one specific cookie?

Replies are listed 'Best First'.
Re: CGI: How to retrieve one specific cookie?
by WebHick (Scribe) on Jun 05, 2001 at 20:02 UTC

    use CGI;, you'll be a lot better off and will have more hair on your head at the end of the day.

    use CGI; my $query = new CGI; my $cookie_data = $query->cookie('Cookie Name');

    Check out The CGI Docs for more information on this.

    Sarah

Re: CGI: How to retrieve one specific cookie?
by BigGuy (Friar) on Jun 05, 2001 at 17:42 UTC
    Here are links i found for cookies without even
    using Super Search, cookies cookies again
    I will leave it up to you to use the Super Search and see what you find on your own.

    BigGuy
    "One World, one Web, one Program" - Microsoft promotional ad
    "Ein Volk, ein Reich, ein Fuhrer" - Adolf Hitler

Re: CGI: How to retrieve one specific cookie?
by AidanLee (Chaplain) on Jun 05, 2001 at 20:04 UTC
    When a user makes a request from your server the request includes all relevant cookies. So either your code (bad idea) or a certain CPAN Module (good idea) has to parse all the cookies before you can get at the one you're looking for.
Re: CGI: How to retrieve one specific cookie?
by RatArsed (Monk) on Jun 05, 2001 at 18:59 UTC
    I don't think it's that simple, you'd have to retirve $ENV{'HTTP_COOKIE'}, and parse all of the cookies out of it, before spotting your own...