Page 1 of 1

Configure sub-domain cookies

Posted: Fri Aug 06, 2010 7:54 am
by alex.barylski
I have three applications (custom built) all of which run off the same physical server but I am using virtual hosts to partition the server, something like:

rpi.mydomain.com
erp.mydomain.com
crm.mydomain.com

Each application has it's own tables, this includes user/authentication tables. I want to keep each application away the others tables directly and instead have each application interact via a basic web service, returning response as JSON. Problem is, my current configuration, when I login to the ERP system, I see a new session file is created, where ideally I would prefer to have each application shared a single session file so a single login will allow users to switch applications without having to login to each all over again.
; The path for which the cookie is valid.
session.cookie_path = /

; The domain for which the cookie is valid.
session.cookie_domain =
What should these values be in order to allow sharing sessions across sub-domains???

Cheers,
Alex

Re: Configure sub-domain cookies

Posted: Sun Oct 03, 2010 9:41 am
by Darhazer
try with ".mydomain.com" for the cookie domain (the dot in the beginning is important part)
Never tried it myself, but this is the way it would work if you use the setcookie function()