Brent_Sachnoff_
Dec 06, 2007Nimbostratus
Assigning 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::cookie insert name tracker value $tracker path "/"
}
This works fine and I can verify it on the HTTP_REQUEST. My problem is I only want to assign this cookie once and never do it again for this particular session. Is there a way to:
on request, check for cookie. If it does not exist, on response issue one out otherwise just log the current cookie.
Thanks,
Brent