Web Connection
Cookie issues
Gravatar is a globally recognized avatar based on your email address. Cookie issues
  Stein Goering
  All
  Mar 12, 2020 @ 11:17am

Trying to troubleshoot some timeout issues at a customer site. Is there a way to programmatically retrieve the cookie info and specifically the expiration value for logging purposes?

WWSESSIONID nITT97AhjLfaLiBS0 registration.spruillarts.org / 2020-03-12T06:21:23.720Z 28

Also, the default cookie lifespan appears to be 20 minutes. How do I override that?

Thanks

--stein

Gravatar is a globally recognized avatar based on your email address. re: Cookie issues
  Rick Strahl
  Stein Goering
  Mar 12, 2020 @ 11:34am

Depends on what the cookie is for.

If it's the session cookie that's controlled by the call to Process.InitSession() and you can pass a timeout to that...

AFAIK you can't retrieve additional info about a cookie on the client - like when it expires or what restrictions are on it. That information is kept by the browser internally when the cookie is created but is not passed forward to the client side (or server side) code. You can see this if you examine the HTTP_COOKIE variable which only gives you the key and value. And whether the cookie is available is based on cookie rules that the browser has approved.

+++ Rick ---

Gravatar is a globally recognized avatar based on your email address. re: Cookie issues
  Stein Goering
  Rick Strahl
  Mar 12, 2020 @ 04:56pm

If it's the session cookie that's controlled by the call to Process.InitSession() and you can pass a timeout to that...

Ah, I had tried that, but I see now I also needed to pass in the 3rd parameter to force it to persist:

	THIS.InitSession('WWSESSIONID', Config.nSessionTimeout,.T.) 
Gravatar is a globally recognized avatar based on your email address. re: Cookie issues
  Rick Strahl
  Stein Goering
  Mar 13, 2020 @ 10:11am

Yes if you don’t persist the the cookie goes away when the browser shuts down.

© 1996-2020