Alex Rivera | Logout

Setting cookies for multiple sub-domains

Asked 2010-03-17T18:56:12.837
12

Is it possible to set a cookie for http://www.example.com from a PHP file located at https://secure.example.com? I have some code that was given to me, that appears to try and fails at this. I was wondering if this is possible at all.

Edit
Report

1 Answer

5

If you set the cookie domain to ".example.com", the cookie will work for all subdomains.

answered 2010-03-17T19:00:24.520

Your Answer