Forum Discussion

fouken_30253's avatar
fouken_30253
Icon for Nimbostratus rankNimbostratus
Sep 21, 2012

Please HELP! Session variable problems!

I have a custom iRule and have found I am unable to access session variables - I have found tons of examples on DevCentral that appears to let you set/get them so what in the world is the deal? This syntax is literally cut and pasted from other iRules.

 

when HTTP_RESPONSE {

 

ACCESS::session data set "session.secureauthCert" "exists"

 

set certChecked [ACCESS::session data get "session.secureauthCert"]

 

log local0. "CERTCHECKED: $certChecked"

 

}

 

  • Silly question, but do you have APM licensed and an access policy applied to the virtual server?
  • Yes, APM is licensed and an access policy is applied to the server. I have found examples of using these commands from the HTTP_RESPONSE event - but can you really?

     

  • I just tested it with an 11.2 box, and yes it does work there. Can you say what the specific error is?

     

  • That's what is odd - I don't seem to get an error, but when I read it back and log it - I get no value. I am at a loss.

     

  • FYI, I'm having the same problem. I'm trying to pass variables between event blocks in an iRule, but ACCESS::session is not working in HTTP_REQUEST. When I do ACCESS::session data set followed immediately by ACCESS::session data get on the same key, I get an empty string as a result.

     

    I did find that the docs for HTTP_REQUEST event (https://devcentral.f5.com/wiki/iRules.HTTP_REQUEST.ashx) does not list ACCESS::session as an available command. However, I still have not found a good way to pass a user-specific variable between event blocks.