簡體   English   中英

Laravel 4 Sessions不能持續使用PHP 5.3

[英]Laravel 4 Sessions Not persisting with PHP 5.3

我在網上看到了類似的問題,但是還沒有運氣修復。 我在本地安裝了laravel 4,並且我的會議效果很好。 我可以使用...登錄

Auth::login($user,true);

然后使用...檢查登錄用戶。

Auth::check()

但是我發現一旦啟動了運行PHP 5.3會話的生產環境,它就不再起作用。 為了進行測試,我嘗試根據其他文章的建議手動設置會話變量,並在其他調用中將其回顯。 再次在本地工作,不在產品上。 有沒有人處理過這個問題?

謝謝

您是否在生產服務器上檢查了會話保存路徑並確保其可寫。 還要確保app / storage目錄已更改為777。

檢查的相關文件將是php.ini

[Session]
; Handler used to store/retrieve data.
; http://php.net/session.save-handler
session.save_handler = files

; Argument passed to save_handler.  In the case of files, this is the path
; where data files are stored. Note: Windows users have to change this
; variable in order to use PHP's session functions.

;
; The path can be defined as:
;
;     session.save_path = "N;/path"
;
; where N is an integer.  Instead of storing all the session files in
; /path, what this will do is use subdirectories N-levels deep, and
; store the session data in those directories.  This is useful if
; your OS has problems with many files in one directory, and is
; a more efficient layout for servers that handle many sessions.

和/app/config/sessions.php

/*
|--------------------------------------------------------------------------
| Session File Location
|--------------------------------------------------------------------------
|
| When using the native session driver, we need a location where session
| files may be stored. A default has been set for you but a different
| location may be specified. This is only needed for file sessions.
|
*/

'files' => storage_path().'/sessions',

/*

可能再次指向存儲文件夾。 我將確保這是777可寫的,並且可以解決您的問題。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM