in reply to unique cookie id?

I tend to use this:
use Digest::MD5 my $cookie_id = Digest::MD5::md5hex($$.time.$ENV{'REMOTE_ADDR'});

With the hash always being 32 chars long. Works for me.

Though maybe $$ under mod_perl is irrelevant here. Hmmm

cLive ;-)

Replies are listed 'Best First'.
Re^2: unique cookie id?
by adrianh (Chancellor) on Dec 23, 2003 at 22:15 UTC
    Digest::MD5::md5hex($$.time.$ENV{'REMOTE_ADDR'});

    This won't be unique if you get two requests to the same Apache process from the same IP in under a second. Something that's fairly likely to happen in many environments I'm afraid :-)

      Unlikely in our instance though :)

      cLive ;-)