Forum Discussion
Trying to set a relative (5 day) expiring cookie with HTTP:RESPOND
With much help from someone who actually knows programming :) we came up with the following
when HTTP_REQUEST { if { [HTTP::cookie exists "intranet-sp-session"] } { set cur_time [clock seconds] set cur_time [expr $cur_time + 432000] set formated_time [clock format $cur_time -format "%a, %d %h %Y %T %Z" -gmt true] HTTP::respond 302 Location ";; "Set-Cookie" "intranet-sp-session=putnamsp;path=/;domain=mycompany.com;expires=$formated_time" } else { set cur_time [clock seconds] set cur_time [expr $cur_time + 432000] set formated_time [clock format $cur_time -format "%a, %d %h %Y %T %Z" -gmt true] HTTP::respond 302 Location "https://mysahrepointssourl.domain.com "Set-Cookie" "intranet-sp-session=putnamsp;path=/;domain=mycompany.com;expires=$formated_time" } }
This successfully sets a cookie that IE will accept and store as a persistent cookie with an expiration value that is 432000 greater than the current time....
Recent Discussions
Related Content
* 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