系統(tǒng)概要
session的內(nèi)容保持在memcache中可以保持服務(wù)的可伸縮性并保證較快的訪問(wèn)速度。
使用指南
session相關(guān)函數(shù)整理
由于php.ini文件由CE平臺(tái)提供,所以相關(guān)項(xiàng)的設(shè)置函數(shù)禁用:
session_cache_expire — Return current cache expire 返回當(dāng)前緩存過(guò)期
session_cache_limiter — Get and/or set the current cache limiter 獲取/設(shè)置當(dāng)前緩存限制
session_get_cookie_params — Get the session cookie parameters 獲取會(huì)話cookie參數(shù)
session_set_cookie_params — Set the session cookie parameters 設(shè)置會(huì)話cookie參數(shù)
由平臺(tái)提供的服務(wù),不需用戶操心的函數(shù)也禁用:
session_save_path — Get and/or set the current session save path 獲取/保存 路徑設(shè)置當(dāng)前會(huì)話
session_set_save_handler — Sets user-level session storage functions 設(shè)置用戶級(jí)別會(huì)議存儲(chǔ)功能
session_module_name — Get and/or set the current session module 獲取/設(shè)置 當(dāng)前會(huì)話模塊
PHP5.3后棄用的函數(shù):
session_is_registered — Find out whether a global variable is registered in a session 查找是否一個(gè)全局變量是在一個(gè)會(huì)話中注冊(cè)
session_register — Register one or more global variables with the current session 注冊(cè)一個(gè)或多個(gè)全局變量與當(dāng)前會(huì)話
session_unregister — Unregister a global variable from the current session 從當(dāng)前會(huì)話注銷(xiāo)全局變量
最終保留的函數(shù):
session_start — Initialize session data 初始化會(huì)話數(shù)據(jù)
session_unset — Free all session variables 釋放所有會(huì)話變量
session_destroy — Destroys all data registered to a session 銷(xiāo)毀注冊(cè)某個(gè)會(huì)話的所有數(shù)據(jù)
session_write_close — Write session data and end session 寫(xiě)會(huì)話數(shù)據(jù)和結(jié)束會(huì)話
session_commit — Alias of session_write_close 對(duì)session_write_close的別名
session_decode — Decodes session data from a string 從一個(gè)字符串解碼會(huì)話數(shù)據(jù)
session_encode — Encodes the current session data as a string 當(dāng)前會(huì)話數(shù)據(jù)編碼為一個(gè)字符串
session_id — Get and/or set the current session id 獲取/設(shè)置當(dāng)前會(huì)話ID
session_regenerate_id — Update the current session id with a newly generated one 更新一個(gè)新生成的的當(dāng)前會(huì)話ID
session_name — Get and/or set the current session name 獲取/設(shè)置 當(dāng)前會(huì)話的名稱(chēng)
更多細(xì)節(jié)請(qǐng)參考:http://www.php.net/manual/en/ref.session.php
新聞熱點(diǎn)
疑難解答
圖片精選