Trouble Setting Cookies

Gregory Lypny gregory.lypny at videotron.ca
Mon Aug 16 12:27:08 CDT 2010


Hi Andre and Jeff,

Thank you for testing my site.  I think the location of PUT NEW HEADER or PUT HEADER in relation ?> or other PUT statements is, as you have mentioned, be the issue, although I can't say that I understand it yet.  It may be why I have not been able to get Andre or John Craig's cookie functions to work when I load them from separate script files using <?rev INCLUDE [...] ?>.

The following stripped down handler works.  I just got it a few minutes ago.

<?rev

put "Set-Cookie:" && "myCookie" & "=" & urlEncode(the seconds) & ";path=/" into theCookie
put new header theCookie
put url ("file:cookieResult.html") into thePage
replace "{message}" with ("Done. <br>" & the long date && the long time) in thePage
put thePage

?>

If you like, you can test it by going to

	http://pareto.on-rev.com/setcookie.irev

and clicking the Set Cookie button.  Click through the pages and you should come to one that displays a cookie named myCookie and whose value is the seconds.

Man, what a headache!  It would be nice if some of our Rev web pros could document the use of cookies using the most basic example possible along with all of the important qualifiers.

Regards,

Gregory



More information about the use-livecode mailing list