DomingoSL
DomingoSL

Reputation: 15494

Cookies accessible from domain.com and www.domain.com

If I create a cookie using PHP as:

setcookie('pctlang',$setlocale,time()+3600*24*365,'/');

From domain.com, my users can access my site using also www.domain.com, but in that url the cookies created in domain.com are not accessible.

Is there any way to solve this?

Upvotes: 1

Views: 106

Answers (1)

Uffo
Uffo

Reputation: 10046

Try this

setcookie('pctlang',$setlocale,time()+3600*24*365,'/',".domain.com");

Upvotes: 2

Related Questions