Forum Discussion
cerpika_14370
Nimbostratus
Aug 12, 2010iRule to send a cookie with every HTTP request
Cookie persistence in v10.2 will only send a cookie back to the client with the first http request/response of the connection. Subsequent requests/responses will not get a cookie sent back. This is a problem for us in our custom app.
I wrote an iRule
when HTTP_REQUEST {
set persistence cookie insert }
But that does not seem to be sending a cookie back with every HTTP response in the connection like I need. Does anyone know how I can do this?
TIA
- naladar_65658
Altostratus
Someone correct me if I am wrong here, but the cookie once it is sent to the client exists on their box until the timeout value has passed or it is manually deleted. So once one is set it lasts until the timeout value has gone passed. This generally only happens when the connection is idle though. If any info is passed and the cookie is used the time out value is generally reset back to the max time out value and the countdown starts over. If a cookie must be present but needs to be new each time, then the only thing I can think of is to change the cookies timeout value to 0 (not sure what this would do, probably just disable your persistence) or you could try to delete the existing cookie that you just set, every time you see it come in with an HTTP request.when HTTP_REQUEST { priority 100 Check to see if the cookie exist in the request if { [HTTP::cookie exists "insert-cookie-name"] } { Delete the cookie HTTP::cookie remove "insert-cookie-name" } when HTTP_REQUEST { priority 200 set persistence cookie insert "insert-cookie-name" } } }
- naladar_65658
Altostratus
Sorry had to post this in two separate posts...when HTTP_REQUEST { set persistence cookie insert "insert-cookie-name" "0d 00:00:00" }
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