Generating Unique Keys

Peter Hansen peter at engcorp.com
Sat Jan 25 16:43:41 EST 2003


Carl Banks wrote:
> 
> Peter Hansen wrote:
> > Mongryong wrote:
> >>
> >> Right now, I mainly need a way to generate unique (web) session keys.
> >> However, it would be nice to have a general purpose function for
> >> generating unique keys.
> >
> > I may be missing something, but what would be wrong with incrementing
> > a variable, starting at "1"?
> >
> > You haven't specified a requirement which looks like it would
> > eliminate this as a possibility.
> 
> Because then a malicious user could easily get access to someone
> else's web session, since they know keys are sequential.  The
> requirement wasn't stated, but it's generally a valid to assume the
> webmaster doesn't want this to happen.

I know that, and you know that (and now the OP knows that), but I 
was hoping to get him to clarify what he wants so he'd be sure
of getting the *right* right answer to his question... teaching
a man to fish and all that. ;-)

-Peter




More information about the Python-list mailing list