Alex Rivera | Logout

PHP cookie problem - www or without www

Asked 2010-02-26T22:00:21.433
16

Why is it that if I create a cookie on www.example.com and check it on example.com, the cookie doesn't exist there? I am planning to just use .htaccess redirect non-www to a www domain. But how do I solve this?

Edit
Report

1 Answer

2
setcookie("CookieName", "value", time()+3600, "/", ".mydomain.com");
answered 2010-02-26T22:08:46.660

Your Answer