mardi 16 octobre 2018

Start laravel's session in another app using php

So At first here is what i did, using laravel session config; i shared the session cookie with *.domain.com. so that all subdomains will have access to the session cookie which hold laravel's encrypted sessionId. so in x.domain.com i was to able to get the sesssionId after decrypting it but the problem is that i can't access the session variables which i have within my laravel app, rather when i try to start the session given the session id it starts a new session rather than using the existed one. enough talkine and here is what i do in my phpFile:

session_id('58BeOrulc4JdJOciIfJ5Yl27KywnrzXz0aeNR7pg');
session_start();
var_dump($_COOKIE);
var_dump($_SESSION); -> empty

i have already tried this whith two simple php files, in which i start a session and echo its Id in the first file and in the second one i start the session with session Id exported from the first file. and i'm able to share session variable between the two.

Can you please enlighten me on what i'm missing. i have a hench that it has to do with the fact that laravel encrypt the cookie session.

Thank You.



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire