Trouble Setting Cookies

Gregory Lypny gregory.lypny at videotron.ca
Thu Aug 12 16:59:22 EDT 2010


Hello everyone,

Having trouble setting my first cookies at On-Rev.  My iRev script pulls in a page template and puts it into a variable called thePage.  thePage starts with the usual stuff, such as

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv=Content-Type content="text/html; charset=ISO-8859-1">
<title>Sign In</title>

My feeble understanding of setting cookies is that I must send off the request before I load the page, so I created a simple cookie like this

	put "myCookie=" into theCookie
	put 6666 after theCookie

I then sent if off with

	put new header ("Set-Cookie:" && theCookie)

and then immediately followed with

	put thePage

But the cookie does not appear in Safari's cookie listing or by checking $_SERVER["HTTP_COOKIE"].  The latter, however, gives me two cookies set by .revolutionss.com, which presumably has something to do with my On-Rev account.

I also tried Andre Garzia's function

	setCookie "myCookie",6666

but struck out there too.  What am I doing wrong?

Regards,

Gregory





More information about the Use-livecode mailing list