hi, how/where to setup the session for subdomains in main config file?
session.cookie_domain = .mydomain.com
so that the session will be available in all my subdomains
hi, how/where to setup the session for subdomains in main config file?
session.cookie_domain = .mydomain.com
so that the session will be available in all my subdomains
but the problem is, am not using Yii at my subdomains and also, am not using
a database table for sessions. what should I do in the config file to solve this ?
and how will i test in a simple php script in my subdomain to know that sessions now exists in the subdomain?
CDbHttpSession derives from CHttpSession. So it doesn’t matter which one you use - they both work the same regarding cookie handling.
As explained in the linked topic:
'session' => array(
'cookieParams' => array(
'domain' => '.example.com',
),
),
By default the session name should be PHPSESSID. So you may create a simple php file containing:
<?php var_dump($_COOKIE['PHPSESSID']); ?>
If it doesn’t work on first try: With browser addons like Firebug it’s very easy to debug since you can see which cookies will be set and transferred.
thanks for the help, this should help someone else in the future…
I solved my problem yesterday, by just printing the contents of the $_SESSION global variable
to get the id/session of the currently logged user