Hi everyone. I’d like to ask how to implement sessions accross subdomains with another web apps, but that another webapss is not developed using Yii. Can I do this ? Please advice Many thanks
Notes : This is what i get from searching through out this forum, but what I get from this wiki is that the two sharing apss must be developed using yii
Specify identical to Yii app cookie params for session:
// it should be placed BEFORE session_start()
$currentCookieParams = session_get_cookie_params();
session_set_cookie_params(
$currentCookieParams["lifetime"],
'/',
'.yourdomain.com',
$currentCookieParams["secure"], // change if needed
$currentCookieParams["httponly"] // change if needed
);
After session start and you’ve login to Yii app, you will see something like:
// $_SESSION
array(
'projectID__id' => 100, // WebUser::id
'projectID__username' => 'admin@mail.com', // WebUser::username
['projectID__<customField>' => '<customFieldValue>', // WebUser::<customField>]
// other data pushed to session
)
Hi. Thanks for the answer. Im so sorry for my late reply, i’ve been away for a few days.
Can you please elaborate what do you mean by "1. Follow instructions into mentioned manual to define correct options on Yii app " ? I still don’t get it yet. Thanks