Technical Forum
Ask questions. Discover Answers.
cancel
Showing results for 
Search instead for 
Did you mean: 

Assign cookie value to APM custom variable

Igor430
Altostratus
Altostratus

Hey all,

Looking for help to create an irule that would check for the XSRF-TOKEN cookie in the HTTP request and if it exists, assign the cookie value to a custom APM variable (for example, session.custom.xsrftoken)

 

Thank you

 

1 ACCEPTED SOLUTION

Pedro_Roure
Cirrus
Cirrus

I believe that something like this should work: 

when ACCESS_ACL_ALLOWED {

if { [HTTP::cookie exists "XSRF-TOKEN"] } {

ACCESS::session data set session.custom.xsrftoken [HTTP::cookie value XSRF-TOKEN]

}

}

View solution in original post

1 REPLY 1

Pedro_Roure
Cirrus
Cirrus

I believe that something like this should work: 

when ACCESS_ACL_ALLOWED {

if { [HTTP::cookie exists "XSRF-TOKEN"] } {

ACCESS::session data set session.custom.xsrftoken [HTTP::cookie value XSRF-TOKEN]

}

}