Forum Discussion
Wes_98712
Feb 09, 2007Nimbostratus
If you want to persist based on a specific cookie that has been programmed into the application, I would suggest you get the name and the length and simply use a cookie hash profile, this is the most efficient that I have found rather than trying to control it via an iRule.
If you are dealing with a weblogic cluster, or any other J2EE/JEE cluster you have to be careful with persistence, if the application is stateless than you shouldn't need persistence, if it is a stateful application, then persistence is pretty much implied, as such you need to start looking at either the embedded application cookie which probably contains the users session information, or in the case of Weblogic and most other J2EE/JEE containers/servlet engines, look at the JSESSIONID, and hash that.
I went through this a few times and found that simply using the cookie has profile with LTM is far more efficient than trying to set a bunch of irule logic to handle the cookie.
The other thing you are doing is trying to create your cookie on the fly, to correspond to the IP address and seemingly the root of URI path, if I am reading that right. The real question it seems is what are you trying to accomplish and if it is simply persisting to the same server with a cookie, then either hash the jsessionID or the internal cookie from the application, or use active cookie insert and set it to the timeout of the application.
iRules are very powerful, but they can be your worst enemy if you don't do them right, in this case it looks like you are trying to accomplish something that a persistence profile will handle a whole lot easier, and it's less administrative overhead.
-Wes