in reply to Re: Maintaining state with CGI.pm
in thread Maintaining state with CGI.pm

Thanks.

I toyed with the database idea last week but was missing the crucial piece of the puzzle you mentioned: having a unique session ID.

I think I'm going to need to purchase another O'Reilly book on this topic and get much more familiar with this topic.

$PM = "Perl Monk's";
$MCF = "Most Clueless Friar";
$nysus = $PM . $MCF;

Replies are listed 'Best First'.
Re: Re: Re: Maintaining state with CGI.pm
by shotgunefx (Parson) on Jun 01, 2001 at 00:38 UTC
    As merlyn has pointed out in the past, you can use the following code to generate a unique session_id. If you are going to use it for generating a file to save the CGI object in, be sure to use Taint checks.
    use MD5; sub generate_id { return substr(MD5->hexhash(time(). {}. rand(). $$. 'blah'), 0, 16) +; }


    You may find this recent discussion relevant.

    -Lee

    "To be civilized is to deny one's nature."