The documentation for the Cookie class is here:
http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_classes_sites_cookie.htm
But lacks documentation for the constructor. From code examples it looks like the constructor takes 5 parameters:
- String name // cookie name
- mixed value // cookie content
- ?? // normally 'null'
- int time // -1 for expiry with session,
otherwise number of seconds to live - boolean ?? // normally 'false'
Can someone confirm this and fill in the blanks for us?
Also, how do you know this?
Best Answer
I have used cookies in the past, and struggled in the same way that you did. My understanding of the constructor is as follows:
Where:
Pretty sure I found this through trial and error and inspecting the HTTP messages - its still my opinion though!
I also recall that the max age didn't seem to have any effect, and I could only generate session cookies, but in the end I couldn't do what I wanted to anyway so I didn't investigate further.