Forum Discussion
Joe_Hsy_45207
Nimbostratus
Apr 24, 2009saving local vars across redirects?
Hi,
I'm trying to save some post parameters into a local var which survives across redirects back to the same vip. Currently, if the post results in a 302 response, the local vars appears to be cleared. I know can save it in a global var in some unique id that ties to the redirect, but I was wondering if there is some cleaner way which essentially extends the life of the local var.
Thanks!
//Joe
- The_Bhattman
Nimbostratus
As far as I know there is no cleaner way. - hoolio
Cirrostratus
If the response which has a reference to the wrong location is being sent through LTM, you could rewrite the reference to avoid the bad request. You can do the rewrite using a stream profile and STREAM::expression iRule (Click here). The concept is similar to this post (Click here). - Joe_Hsy_45207
Nimbostratus
Hi Aaron, - hoolio
Cirrostratus
Hi Joe, - Joe_Hsy_45207
Nimbostratus
Hi Aaron, - hoolio
Cirrostratus
I don't think you could force the client to re-use the existing TCP connection to send the GET request following the redirect. What about appending the parameters to the redirect Location header so the client submits them in the subsequent request? Another option might be to append a Set-Cookie header to the redirect response with the parameter name / values. - Joe_Hsy_45207
Nimbostratus
Thanks, Aaron. Yes those are all possible though it is preferred not to alter the redirected GET request in any way be it in the URL or cookies. I will go with the global var and make sure to clean it up. Any best practices for cleaning up global vars? - hoolio
Cirrostratus
Hi Joe, - Joe_Hsy_45207
Nimbostratus
Hi Aaron,
Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects