~~~
when HTTP_REQUEST {
if { [HTTP::cookie exists "MRHSession"] } {
Remember the session ID to be used on the response
set MRHSHint [HTTP::cookie value "MRHSession"]
Strip off the SharePoint hint cookie so backed does not see it
if { [HTTP::cookie exists "MRHSHint"] } {
HTTP::cookie remove "MRHSHint"
}
} elseif { [HTTP::cookie exists "MRHSHint"] } {
HTTP::cookie insert name "MRHSession" value [HTTP::cookie value "MRHSHint"]
Refresh the SharePoint hint cookie
set MRHSHint [HTTP::cookie value "MRHSHint"]
Strip off the SharePoint hint cookie so backed does not see it
HTTP::cookie remove "MRHSHint"
}
}
when ACCESS_ACL_ALLOWED {
set timeout [ACCESS::session data get "session.inactivity_timeout"]
set secure [PROFILE::access "secure_cookie"]
set clientip [ACCESS::session data get "session.user.clientip"]
Check source address
if { not ( $clientip equals [IP::remote_addr] ) } {
ACCESS::respond 401 content "Error: Failure in Source Address
Check" Connection Close
}
}
when HTTP_RESPONSE {
if { not [info exists timeout] } {
set timeout 60
}
if { not [info exists secure] } {
set secure 1
}
if { [info exists MRHSHint] } {
Insert a SharePoint hint cookie
HTTP::cookie insert name "MRHSHint" value $MRHSHint
Keep the life of SharePoint hint cookie same as session cookie
Also make it persistent.
HTTP::cookie expires "MRHSHint" $timeout relative
if { $secure equals "1" } {
HTTP::cookie secure "MRHSHint" enable
}
HTTP::cookie path "MRHSHint" "/"
unset MRHSHint
}
}
~~~