Forum Discussion
sgoodliff_83611
Nimbostratus
Jan 18, 2008cookie based connection limits
Hello,
I've been playing with this irule which is meant to set a cookie per client. But I'm using firefox and it sets 4 cookies. one per http request, Is there any way for it to be a bit cleverer and only set one cookie per client. I was thinking about checking if it is a keep alive request and seeing if that helped.
Any suggestions ?
Thanks
http://devcentral.f5.com/wiki/default.aspx/iRules/HTTPSessionLimit.html
4 Replies
- Colin_Walker_12Historic F5 AccountYou might try making a small addition to the HTTP_RESPONSE stanza.
when HTTP_RESPONSE { ; insert cookie if needed if {$need_cookie == 1} { HTTP::cookie insert name "ClientID" value $client_id set need_cookie 0 } }
This is the only way I can really think that there would be multiple cookies inserted. The code looks good other than that.
Colin - sgoodliff_83611
Nimbostratus
Hello,
I've got it sorted.
swap:
HTTP::cookie insert name "ClientID" value $client_id
For this:
HTTP::cookie insert name "ClientID" value $client_id path "/"
And now it works much better.
Thanks - Deb_Allen_18Historic F5 AccountExcellent catch, I've updated the codeshare sample.
thanks!
/deb - hoolio
Cirrostratus
Out of curiosity, why would setting the path to / make a difference? I would have assumed that if the path is not set it would default to any path (ie, /).
Aaron
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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
