Forum Discussion
steph_85518
Nimbostratus
Dec 20, 2013ACCESS::session exists not working
This is really killing me...I'm trying to do something simple here just check if a APM sid is valid in the the HTTP_REQUEST event that I had previously stored in a cookie. I know the session is valid...
John_Alam_45640
Dec 20, 2013Historic F5 Account
when HTTP_REQUEST {
Check to see if the session exists in the LastMRH_Session cookie
This cookie contains the actual access session ID
if { [HTTP::cookie exists LastMRH_Session] } {
log local0. "Session ID is [HTTP::cookie value LastMRH_Session]"
set mySessionID [HTTP::cookie value LastMRH_Session]
set TableEntry "[table lookup -subtable "AccessTable" $mySessionID]"
log local0. "For sessionID $mySessionID the entry was $TableEntry"
if { $TableEntry ne "" } {
HTTP::cookie insert name saved_uri value "$TableEntry"
HTTP::uri $TableEntry
}
} else {
log local0. "No cookie called LastMRH_Session yet."
}
}
when ACCESS_POLICY_AGENT_EVENT {
if { [ACCESS::policy agent_id] eq "login_success" } {
set mySessionID [ACCESS::session data get session.user.sessionid]
set myURI [ACCESS::session data get session.server.landinguri]
add an entry to the table
table add -subtable "AccessTable" $mySessionID $myURI 300 300
log local0. "Session ID: $mySessionID"
}
}
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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