Does anyone know how to create a cookie (eg. username=“joe”) and later retrieve or reference that cookie using only formula?
The help is not quite helpful on this. The usage of @SetHTTPHeader is not clearly explained, as it seems to use a field called “Set-Cookie”, but it doesn’t explain how to create the “Set-Cookie” field etc etc.
If anyone could help it would be much appreciated.
Subject: How to create and retrieve cookie with formula?
The “Set-Cookie” is not the name of the cookie - it is only a command for the @SetHTTPHeader function. This command tells the function to create or modify an existing cookie. The name of the cookie is determined by the value entered before the equal sign (“=”). So in this case:@SetHTTPHeader(“Set-Cookie”; “SHOP-CART=4444”)
the command will first try to modify an existing cookie with the name “SHOP-CART”. If this cookie isn’t found - then it is created.
On the other hand - I have no idea of how to retreive the cookie value with only @Formula - it seems that You are forced to used JavaScript for this…
This may have been something I was doing wrong, but I couldn’t get the cookies to save until I changed the expires= to the format expires=Fri, 31-Dec-2004 00:00:00 GMT
Using @Text with @Now to set the expire date of the cookie didn’t work (for me), just thought I add this to the thread in case someone else runs into the same problem.