in reply to Cookies Tutorial

I'm not a big fan of "about.com" but they have a pretty good tutorial on cookies. I used it to teach myself how to get started. Quick code example below.
#!/usr/bin/perl -t use CGI; my $q = CGI->new; $session{"user_id"}=$userid; $session{"password"}=$passwd; $session{"timecode"}=$time; $cookie = $q->cookie(-name=>'sessionID', -value=>\%session, -expires=>'+6h', -secure=>0); print $q->redirect(-uri=>"index.cgi", -cookie=>$cookie);
Always use '-t' mode for your cgi scripts, it instructs Perl to taint any outside input. Also remember, anything you put in a cookie is stored in plain text unless you encrypt it before you place it in the cookie.

Replies are listed 'Best First'.
Re^2: Cookies Tutorial
by herveus (Prior) on Jan 26, 2005 at 12:28 UTC
    Howdy!

    ummm... that's the -T flag (uppercase not lowercase).

    yours,
    Michael