Forum Discussion
If you are trying to persist based on JSession cookie, you should look at and follow the example in Overview of universal persistence
If the session has timed out, why does it matter which server the user re-connects to? They will need to re-authenticate, and presumably, any server they land on should be able to service them?
I think it will be a bit involved to accomplish this. You would need to somehow store the server's IP (check out irule session/table commands) address, and match that with the JSessionId value, and whenever you see a particular JsessionId, you would use the pool member command to send the connections directly to the required server retrieved from the session table... then you have to make sure you update the JsessionID whenever it changes, and think about cleanup too.
Alternatively, you could encode the desired IP address in a cookie sent to the client whenever the server sends a 302, and then whenever you get a request that contains this cookie, use pool member command to chose that IP address, and then unset the cookie, and add a persistence entry after all that has been done.
I think I can work out the logic, I'm not good with irule syntax, so can't provide working sample code. I can share pseudocode I think could serve, if you need guidance.