I am trying to get cookies working with a login page.
I have read a lot of tutorials on the net, but I just doesn't get all of it.
It seems that a rule is that you can't have any printable characters before setting a cookie. My question is then, what if you use templates for your site? (include()). Also, you have to use a form (html) for users to type their username/password before setting the cookie, so how is this done?
Also, if I want any scripts on my domain to be able to access the cookie, is it right to use '/' then? Example:
Thanks in advance.PHP Code:setcookie("testcookie", "value", time() + (7 * 86400), '/', '.domain.com' );




Bookmarks