Forum Discussion
Walter_Kacynski
Feb 05, 2015Cirrostratus
PHP and session variable substitution
I want to evaluate the content of a session variable during logon page processing.
session.server.landinguri=/?pw=0
This doesn't work
$landingUri = '%{session.server.landinguri}';
$pos =...
Michael_Jenkins
Feb 05, 2015Cirrostratus
In my experience of trying to do this, what I think is going on is this...
- Make customization including session variable
$landingUri = '%{session.server.landinguri}';
- PHP executes when page is accessed, setting landingUri to the string
.%{session.server.landinguri}
-
As the processed HTML goes down the pipe to the client after PHP has executed, APM rewrites
to the%{session.server.landinguri}
(or whatever the value should be)./?pw=0
- So if you were to
the variable in PHP, the resulting HTML from the PHP perspective would beecho
, but further down the line, APM rewrites that within the HTML to the actual value.%{session.server.landinguri}
- So if you were to
All that to say, when you do the
strpos
, it's testing against the value %{session.server.landinguri}
, not the expected value /?pw=0
.
For me, the only way to overcome this kind of thing was to do testing within javascript instead, which may not be feasible depending on what you want to do.
Another option might be to use a policy agent event in the VPE to do some work and set a custom session variable you want to echo on the page and then use that instead.
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