Forum Moderators: coopster
I am learning how to set a cookie with php.
I have the following code at the top of my page:
setcookie("user", "name", time()+3600, "/", "", 0);
this works but i would like to know where the cookie is in my cookies folder. Its not named localhost, my computers name or my ip address. What would it be called if you don't set a domain name?
Also, is this the right way to set a cookie on local host? I tried putting localhost as my domain but since i'm using xp and ie6 it doesn't work.
Thanks for any info.
no clue to be honest, sometimes I can't find them at all, which seems strange. I use my 'cookie manager' in mozilla to see them.
>> What would it be called if you don't set a domain name?
well that depends on how you called that script. What domain did you use?
domain name
localhost
127.0.0.1
>> Also, is this the right way to set a cookie on local host?
the right way to do it is to set it properly for the domain. There is almost never a real case where you need to set a cookie on localhost
You can search their site using keywords like "persistent cookie" or "session cookie" for plenty of reading. But, it's a lot easier to just download a different browser ;)