in reply to Simple Session?

Besides the other good suggestions, if you need a cryptographically strong session key, you can use what Apache::Session uses:
use MD5; sub generate_id { return substr(MD5->hexhash(time(). {}. rand(). $$. 'blah'), 0, 16) +; }

-- Randal L. Schwartz, Perl hacker

Replies are listed 'Best First'.
Re: Simple Session?
by Dominus (Parson) on Apr 13, 2001 at 22:01 UTC
    Says merlyn:
    sub generate_id { return substr(MD5->hexhash(time(). {}. rand(). $$. 'blah'), 0, 1 +6); }
    That {} seems like something of an oddity. I guess they threw it in on the theory that it couldn't hurt.

    (Part of me wants to say that [] would accomplish the same purpose, but with less memory. No doubt tye will not consider this funny. :-) )