Gunel Gunel - 5 months ago 49
PHP Question

Session in Laravel 5.4.3 doesn't works

I have a problem with session in laravel ,
In localhost works fine , but in shared hosting (webhostingworld) dosen't work
Same code.
This is the code in session.php

return [
'driver' => env('SESSION_DRIVER', 'file'),
'lifetime' => 120,
'expire_on_close' => false,
'encrypt' => false,
'files' => storage_path('framework/sessions'),
'connection' => null,
'table' => 'sessions',
'store' => null,
'lottery' => [2, 100],
'cookie' => 'laravel_session',
'path' => '/',
'domain' => '',
'secure' => env('SESSION_SECURE_COOKIE', false),
'http_only' => true,


This is the code in web.php

return Session::get('test'); //here returning testing
return Session::get('test'); //but here return empty result

Server PHP Version 5.6.31 , SSH access is not possible to shared host

Answer Source

Problem was found, i have created settings.php file for uploading images specific folders, after deleting that file from hosting session worked

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download