Sharing session with Laravel 5.1 and Laravel 5.5 app
Hi, I'm trying to share sessions between Laravel 5.5 app and a Laravel 5.1 app.
I configured sessions configurations of Laravel 5.5 app to 5.1 app (since 5.1 app is the master app). I'm sharing the same domain and structure is as follows,
www.<5.1 app>.com/<5.5 app name>
I was able to see sessions in 5.5 app when I set sessions in 5.1 app . But the problem is I cannot seems to share Auth users across these two apps. I understand there are few different changes in Authenticating methods for an example in 5.5 app it looks for the session key like login_web_xxx wherein 5.1 app it looks for login_xxxx.
I suppose if I change that session key, I might be able to access 5.1 user data. In 5.5 it uses following method to get the session key for the user (SessionGuard line 616)
/**
* Get a unique identifier for the auth session value.
*
* @return string
*/
public function getName()
{
return 'login_'.$this->name.'_'.sha1(static::class);
}
Can anyone suggest me what the logic it has used to get the session key in Laravel 5.1 app?
I think it's possible when you use one as a the main domain and the other as a subdomain. From there you should set the config/session.php and assign the following value to the domain key