cjm2671
cjm2671

Reputation: 19506

Cross subdomain cookie handling for session?

Is it possible to set an auth cookie that would be valid on:

Or will each subdomain always require it's own cookie?

Upvotes: 9

Views: 4689

Answers (1)

Richard
Richard

Reputation: 22036

You can use cookies across sub domains if you specify the cookie to be attached to the domain:

.domain.com

note the dot in front.

See here for reference:

http://www.jotlab.com/2008/04/08/howto-get-cookies-across-subdomains-php/

Upvotes: 11

Related Questions