先確認會話是否自動開啟還是需要通過session_start()來手動開啟
; 指定會話模塊是否在請求開始時自動啟動一個會話
; Initialize session on request startup
;
session
在客戶端
; 指定是否在客戶端用 cookie 來存放會話 ID
; Whether to use cookies
;
session
; 指定是否在客戶端僅僅使用 cookie 來存放會話 ID
; This option forces PHP to fetch and use a cookie for storing and maintaining
; the session id
; session hijacking when not specifying and managing your own session id
; not the end all be all of session hijacking defense
;
session
如果確認存儲在cookie中
; Name of the session (used as cookie name)
;
session
; Lifetime in seconds of cookie or
;
session
; The path for which the cookie is valid
;
session
; The domain for which the cookie is valid
;
session
; Whether or not to add the httpOnly flag to the cookie
;
session
在服務器端
; Handler used to store/retrieve data
;
session
; Argument passed to save_handler
; where data files are stored
; variable in order to use PHP
;
; The path can be defined as:
;
; session
;
; where N is an integer
; /path
; store the session data in those directories
; or your OS have problems with lots of files in one directory
; a more efficient layout for servers that handle lots of sessions
;
; NOTE
; You can use the script in the ext/session dir for that purpose
; NOTE
; use subdirectories for session storage
;
; The file storage module creates files using mode
; You can change that by using
;
; session
;
; where MODE is the octal representation of the mode
; does not overwrite the process
;
;session
PHP支持通過session_set_save_handler來實現會話處理器的自定義open
接下來重點講解memcache(d?)會話處理器
Memcache模塊提供了於memcached方便的面向過程及面向對象的接口
Memcache模塊同時提供了一個session 處理器 (memcache)
更多關於memcached的信息請參見»
memcached是一個高性能分布式的內存對象緩存系統
此擴展使用了libmemcached庫提供的api與memcached服務端進行交互
關於libmemcached的更多信息可以在» 查看
memcache會話處理器配置
session
session
數據庫處理器可以使用Session PgSQL來實現(此擴展被認為已無人維護)
From:http://tw.wingwit.com/Article/program/PHP/201311/21106.html