Hi everyone,
I have a small problem. I am developing applications which use sessions. Now these applications will live in a sub folders off the main domain ie. http://xxxxx.com/app1, http://xxxxx.com/app2, http://xxxxx.com/app3 etc.
Now when I start the session and retrieve information for the user against the session, I can get the same information in each of the apps. This is not what I want. I would like all cart info in http://xxxxx.com/app1 to be different to all cart info in http://xxxxx.com/app2.
I am setting the sessions like $_SESSION['app1']['cartID'], $_SESSION['app2']['cartID'] which I assume is fine however PHP is setting the same value because I imagine it is getting the cartID from http://xxxxx.com.
Please help, very important.
Thanks
PHP Session
Moderator: General Moderators
Re: PHP Session
session_set_cookie_params
Re: PHP Session
Thanks for the reply however everything I have tried doesnt work. It all seems to be relating to app1.xxx.com, app2.xxx.com.
Can you please post a sample?
What I have tried are:
session_set_cookie_params(60*60*24*5, "/app1/", "xxx.com");
session_set_cookie_params(60*60*24*5, "/app1", "xxx.com");
session_set_cookie_params(60*60*24*5, "app1", "xxx.com");
Plus all other combinations using slash '/' in domain and path.
Thanks
Can you please post a sample?
What I have tried are:
session_set_cookie_params(60*60*24*5, "/app1/", "xxx.com");
session_set_cookie_params(60*60*24*5, "/app1", "xxx.com");
session_set_cookie_params(60*60*24*5, "app1", "xxx.com");
Plus all other combinations using slash '/' in domain and path.
Thanks
Re: PHP Session
How about this:
session_set_cookie_params(60*60*24*5, "/app1/", " .xxx.com");
(no time to test it, sorry)
session_set_cookie_params(60*60*24*5, "/app1/", " .xxx.com");
(no time to test it, sorry)