Forum Discussion

Robert_47833's avatar
Robert_47833
Icon for Altostratus rankAltostratus
Feb 15, 2015
Solved

cookie set in HTTP::respond 302 ,but I need to set expires as 7 days for this cookie

when HTTP_REQUEST { set cookie [format "%s=%s; path=/;" cookeiname cookievalue] HTTP::respond 302 Location "https://[HTTP::host]/xyz" "Set-Cookie" $cookie }

 

I need to set this cookie's expire time as 7 days ,it is around 604800seconds

 

how to achieve this?

 

It seems I can't modify this in HTTP::reponse since this reponse is initiated from LTM,and it is not evaluated in HTTP::reponse .

 

  • Try "Max-age=604800"

    set cookie [format "%s=%s; Max-Age=604800; path=/; domain=%s" $ckname $ckvalue ".domain.org"]

4 Replies

  • Try "Max-age=604800"

    set cookie [format "%s=%s; Max-Age=604800; path=/; domain=%s" $ckname $ckvalue ".domain.org"]

  • kunjan's avatar
    kunjan
    Icon for Nimbostratus rankNimbostratus

    Try "Max-age=604800"

    set cookie [format "%s=%s; Max-Age=604800; path=/; domain=%s" $ckname $ckvalue ".domain.org"]