Page 1 of 1

Cookie name problem?

Posted: Fri Jan 09, 2009 11:41 pm
by kalpesh
Hi, I see most of sites storing their cookie in browser having file name like this.
Cookie:administrator@example.com/

but When i try to do like that cookie is not created.
But it works when i do this.
setcookie ("Example", $value,time()+3600,"/example.com");
But it does not work like this:
setcookie ("Example", $value,time()+3600,"Cookie:administartor@example.com/");

I try to create cookie like all other sites do.
Please Help me.
Thanks in advance.

Re: Cookie name problem?

Posted: Fri Jan 09, 2009 11:51 pm
by SteveC
kalpesh wrote:Hi, I see most of sites storing their cookie in browser having file name like this.
Cookie:administrator@example.com/

but When i try to do like that cookie is not created.
But it works when i do this.
setcookie ("Example", $value,time()+3600,"/example.com");
But it does not work like this:
setcookie ("Example", $value,time()+3600,"Cookie:administartor@example.com/");

I try to create cookie like all other sites do.
Please Help me.
Thanks in advance.

Code: Select all

setcookie ("Example", $value,time()+3600,"/",".example.com");

That's the correct way. The cookie you're seeing stored is how it is being represented by the browser, not how the websites are storing it.