ConnectAGAIN 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.

Replies are listed 'Best First'.
Re: Capturing cookies
by wfsp (Abbot) on Dec 29, 2004 at 16:24 UTC
    Hi Tom,

    Welcome to the monestary!

    Is your web site, like mine, a collection of html pages? If it is then Perl can't do this directly.

    If one of your pages has a form that a visitor can fill out and then click the submit button then you may be in business. You can set the form up to 'submit' the form details to a cgi script written in Perl. The script can then set and retrieve cookies (as edan has pointed out above).

    Have a look at the cgi tutorials to get an idea of what is involved.

    Best of luck

    btw you can get quite a lot of useful info from the access logs

Re: Capturing cookies
by edan (Curate) on Dec 29, 2004 at 16:19 UTC

    Untested code:

    use CGI::Cookie; use strict; my %cookies = CGI::Cookie->fetch(); warn "$_: " . $cookies{$_}->value() for keys %cookies;
    --
    edan

Re: Capturing cookies
by dragonchild (Archbishop) on Dec 29, 2004 at 16:04 UTC
    What have you tried? How has it failed? What ideas have you had?

    More importantly, why do you want to do this? This sounds somewhat spyware-ish ...

    Being right, does not endow the right to be rude; politeness costs nothing.
    Being unknowing, is not the same as being stupid.
    Expressing a contrary opinion, whether to the individual or the group, is more often a sign of deeper thought than of cantankerous belligerence.
    Do not mistake your goals as the only goals; your opinion as the only opinion; your confidence as correctness. Saying you know better is not the same as explaining you know better.