APM Session Variables fail to update in cache
I thought maybe someone can help me understand this. I have a Access Policy that contains a macro loop. Inside the macro there is a event id called in an irule that sets a session variable for example session.custom.test = 1. I then have a empty action that looks at this variable to determine which path in the policy it takes. I have found that any iteration of the loop after the first, the Access Policy does not read the updated value of this variable, but the past value from the first iteration of the loop.
I thought well maybe just setting it in the irule will not update the cache and VPE is pulling from cache. So I created a temp variable in the irule and then I set it to the session.custom.test in a variable assign inside the VPE. Same results. Can anyone tell me what I am doing wrong? Seems like a fairly simple procedure to be stuck on.