Forum Discussion
Brent_Sachnoff_
Nimbostratus
Dec 06, 2007Assigning cookies only once
I'm trying to assign a client a cookie that will be psuedo random using:
when HTTP_RESPONSE {
expr srand([clock clicks])
set tracker [expr (rand() * 999) + 10]
HTTP::cooki...
Joe_Hsy_45207
Nimbostratus
Jun 01, 2009Hi Aaron,
In your example, is the reason you reseed with srand on every response to prevent the possibility of another iRule reseeding with the same seed and thus rand() producing the same results? What is the performance overhead of reseding on every http hit? Wouldn't using just [clock ticks] provide a sufficient unique id?
Thanks!
//Joe
Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects