Forum Discussion
Joern_Oltmann
Nimbostratus
Jan 28, 2013Set cookie in http request AND response
Hi all,
this is my first Topic, so sorry if somthing wrong ;-)
I would like to set a cookie (if not set) in the http request. So the application see if the user are new.
...
hoolio
Cirrostratus
Jan 29, 2013http://devcentral.f5.com/Community/GroupDetails/tabid/1082223/aff/5/afv/topic/aft/2163201/afc/2263687/Default.aspx
Here are two options. The rand option should be more efficient but not cryptographically secure. You can compare the CPU usage using the timing command.
Use rand() to generate a psuedo-random 8 digit number (not cryptographically secure)
format %010s [expr { int(100000000 * rand()) }]
Use AES::key to generate a cryptographically secure unique ID
set uid [string range [AES::key 256] 8 end]
Use timing to do a performance comparison:
https://devcentral.f5.com/wiki/iRules.timing.ashx
Aaron
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