Reputation: 1020
I have two app in one server, the first is Laravel based and the second is a pure PHP app.
Now I want to save some variables in the session in laravel and use it in my pure PHP app.
I tried various ways to store session variables but any of them won't worked.
Session::put('key', 'value');
$request->session()->put('key', 'value');
$_SESSION['key'] = 'value';
None of the above storing method allowed me to fetch the session in my pure PHP app.
I print_r($_SESSION)
this in pure PHP app and return null.
Upvotes: 2
Views: 1908
Reputation: 493
I think you forgot using session_start()
before use $_SESSION
. Please try it.
Upvotes: -1
Reputation: 579
Laravel does not use the Session to save its sessions, it uses, file, cookie, redis or other drives, which is why you can not access directly in $ _SESSION.
https://laravel.com/docs/5.4/session#configuration
Upvotes: 1