Forum Discussion
Kevin_Stewart
Jan 29, 2013Employee
Expanding on Aaron's recommendation, I typically use the concatenation of two AES functions to return a unique ID:
Ex.
set session_key "[string range [AES::key 128] 15 end][string range [AES::key 128] 15 end]"
And here's something that might work for you:
when HTTP_REQUEST {
if { not ( [HTTP::cookie exists _global] ) } {
set session_key "[string range [AES::key 128] 15 end][string range [AES::key 128] 15 end]"
HTTP::header insert "X-GLOBAL-Session" "New"
HTTP::cookie insert name "_global" value $session_key
}
}
when HTTP_RESPONSE {
if { [info exists session_key] and $session_key ne "" } {
HTTP::cookie insert name "_global" value $session_key
unset session_key
}
}