Forum Discussion
Christopher_Kei
Nimbostratus
May 23, 2006iRule to Persist based on ASP.NET Session ID
I am trying to create an iRule that will force traffic to persist to the same server based on the ASP.NET_SessionId cookie that the application inserts. I do not want the BigIP to insert its own cookie. Is there a way to do this? Here's the rule that I am working with:
when HTTP_REQUEST {
if { [HTTP::cookie exists "ASP.NET_SessionId"] } {
persist uie [HTTP::cookie "ASP.NET_SessionId"] }
}
Thanks.
Chris
3 Replies
- Christopher_Kei
Nimbostratus
We were given the following iRule by F5, but it is not working correctly.
when HTTP_REQUEST {
set SessionId [HTTP::cookie ASP.NET_SessionId]
log local0. "Request SessionId is: $SessionId"
if { $SessionId != "" } { persist uie $SessionID }
}
when HTTP_RESPONSE {
set SessionId [findstr [HTTP::cookie names] "ASP.NET_SessionId" 18 24]
log local0. "Response SessionId is: $SessionId"
if { $SessionId != "" }{ persist add uie $SessionId }
}
We added this iRule to a Universal persistance profile. Now when we browse to the application, images are not being displayed. When we log into the application, we get a page cannot be displayed error.
Any ideas/suggestions would be great.
Thanks.
Chris - Deb_Allen_18Historic F5 AccountThis rule did work with only a single cookie being set by the server.
Follow-up post here requesting insight on extracting one of multiple cookies set by the server: Click here
/d - Deb_Allen_18Historic F5 AccountIf you don't mind, let's work your other thread, since you've included a better problem description there:
http://devcentral.f5.com/default.aspx?tabid=28&view=topic&forumid=5&postid=10331
Click here
/deb
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
