mozunk Posted November 20, 2007 Share Posted November 20, 2007 I searched but couldn't find a clear answer so I'm sorry if this is a repeat. If you point me in the right direction, I'll go When I set a cookie, it only sets it on my domain without the www. (so if someone uses www.domain.com, the cookie doesn't work). Here's what I have: setcookie("matewan_login",$joined,time()+62899200); Suggestions? I appreciate everyone's time... Link to comment https://forums.phpfreaks.com/topic/78081-set-cookie-function-for-both-wwwdomaincom-and-domaincom/ Share on other sites More sharing options...
thebadbad Posted November 20, 2007 Share Posted November 20, 2007 Just specify your domain with a dot in front (and if you want the cookie to work in all directories of you domain, use a slash as below): <?php setcookie('matewan_login', $joined, time()+62899200, '/', '.domain.com'); ?> Link to comment https://forums.phpfreaks.com/topic/78081-set-cookie-function-for-both-wwwdomaincom-and-domaincom/#findComment-395185 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.