in reply to Re: Saving State w/o Cookies
in thread Saving State w/o Cookies

One way of doing this is to calculate an id off of (say) the current UNIX time, plus maybe the first 3 letters of their first name plus the first 3 letters of their last name

Better yet, use the process idea (handily stored by perl in the variable $$) along with the time (stored by perl as $^T - the time the script started). Using this two ensures for a pretty unique string, since you can't have two processes with the same PID running at the same time.

Replies are listed 'Best First'.
RE: RE: Re: Saving State w/o Cookies
by Adam (Vicar) on Oct 20, 2000 at 22:42 UTC
    The issues involved with generating random IDs have been discussed multiple times on this site. Check out Randomizing Unique ID?, which is one of the more long winded threads. (My particular solution was RE: RE: RE: Randomizing Unique ID? but you should really read the whole thread.)
RE: RE: Re: Saving State w/o Cookies
by swiftone (Curate) on Oct 20, 2000 at 20:35 UTC
    Using this two ensures for a pretty unique string, since you can't have two processes with the same PID running at the same time.

    Unless you're running mod_perl...and the process will have the same PID everytime.