Hi,
Can you elaborate on what's not working with the iRule?
To answer your questions:
a) how to delete entries from persistence hash
The persistence table entries are removed after the timeout expires. In the code you listed above, it's set to 1800 seconds. If you wanted to manually delete a persistence record from the iRule, you could use 'persist delete ' (
Click here).
b) if browser is not closed for a long time and it sends an old stale jsessionid, this iRule should forward the request to the virtual server rather than rejecting the request.
Using the above rule, no request should ever get dropped or rejected. If a request contains a persistence token (either in the URI or the cookie) which has already expired and been removed from the BIG-IP persistence table, then the request will be load balanced to a new pool member.
If you don't want to use session-based persistence, you could either configure the application or the iRule to set an expiration time on the cookie (
Click here). This would instruct the client browser to not send the cookie after a certain amount of time.
Aaron