[英]Session in Laravel 5.4.3 doesn't works
我在laravel中遇到會話問題,在localhost中工作正常,但在共享托管(webhostingworld)中無法正常工作相同的代碼。 這是session.php中的代碼
<?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,
];
這是web.php中的代碼
Route::get('/put',function(){
Session::put('test','testing');
return Session::get('test'); //here returning testing
});
Route::get('/get',function(){
return Session::get('test'); //but here return empty result
});
服務器PHP版本5.6.31,無法通過SSH訪問共享主機
從主機會話刪除該文件后,發現問題,我已經創建了用於上傳圖像特定文件夾的settings.php文件
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.