Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: unique cookie id?

by cees (Curate)
on Dec 23, 2003 at 17:51 UTC ( [id://316664]=note: print w/replies, xml ) Need Help??


in reply to unique cookie id?

Since you are using mod_perl, you might as well use apache's mod_unique_id to generate unique IDs for you. From the docs:

This module provides a magic token for each request which is guaranteed to be unique across "all" requests under very specific conditions. The unique identifier is even unique across multiple machines in a properly configured cluster of machines. The environment variable UNIQUE_ID is set to the identifier for each request.

Every request will have $ENV{UNIQUE_ID} set to a unique value.

If for some reason you do not have access to use this module, then you can look at the source code for the implementation that they use to generate a unique ID in an apache environment (remember that in mod_perl2 you may have to deal with a threaded environment).

Update: Just remembered, have a look at Apache::Session::Generate::MD5 for a mechanism similar to yours that Apache::Session uses to generate Session IDs. I would still recommend going with mod_unique_id, but this could be an option for you as well. Please note that you do not need to use Apache::Session in order to use Apache::Session::Generate::MD5...

- Cees

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://316664]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (7)
As of 2024-03-29 12:51 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found