Coder's Guild Mailing List

Setting Cookies in Perl

Posted by Frank Hale on 1999-03-21

I got the following function to set cookies. It works good but how do I
make the cookies persistant? As soon as the browser is exited and
restarted it forgets my cookies.

sub setCookie {
    my($name, $val, $exp, $path, $dom, $secure) = @_;

    print("Set-Cookie: $name=$val, expires=$exp, path=$path,
domain=$dom");
    print(", $secure") if defined($secure);
    print("\n");
}

-- 
From:      Frank Hale
Email:     frankhale@xxxxxxxx.xxx.xxx   
ICQ:       7205161          
Website:   http://www.franksstuff.com