作者:y10k
session的配置
首先打开你的php.ini文件,找到session的部分,如下:(注意,分号后面的是注释)
[Session]
; Handler used to store/retrieve data.
session.save_handler = files ;这个是session的方式,默认的files就可以了,代表用文件
储
存
; Argument passed to save_handler. In the case of files, this is the path
; where data files are stored.
session.save_path = /tmp ; 这个是session的保存路径,比如你是c盘,那么默认就是
c:/tmp,
所以如果出现“Warning: open(/tmpsess_cc8b04f146a1e0494bc464305da92ea1, O_RDWR)
failed”这样子的错误,你可以修改这个路径,或者在根目录下面建立一个tmp的文件夹
; Whether to use cookies.
session.use_cookies = 1 ;sessionid的传递方式,默认是cookie,推荐使用
; Name of the session (used as cookie name).
session.name = PHPSESSID ;sessionid的名称,保存在cookie里面的,要避免同名
; Initialize session on request startup.
session.auto_start = 0 ;是否自动启动session,默认为不是,不需要修改
; Lifetime in seconds of cookie or, if 0, until browser is restarted.
session.cookie_lifetime = 0 ;sessionid的cookie生存时间,0代表知道浏览器关闭
; The path for which the cookie is valid.
session.cookie_path = / ;sessionid的cookie路径,不需要修改
; The domain for which the cookie is valid.
session.cookie_domain = ;;sessionid的cookie域名,不需要修改
; Handler used to serialize data. php is the standard serializer of PHP.
session.serialize_handler = php ;保存data的默认文件名后缀,不需要修改
; Percentual probability that the 'garbage collection' process is started
; on every session initialization.
session.gc_probability = 1
; After this number of seconds, stored data will be seen as 'garbage' and
; cleaned up by the garbage collection process.
session.gc_maxlifetime = 1440 ;session文件的保存时间
; Check HTTP Referer to invalidate externally stored URLs containing ids.
session.referer_check =
; How many bytes to read from the file.
session.entropy_length = 0
; Specified here to create the session id.
session.entropy_file =
;session.entropy_length = 16
;session.entropy_file = /dev/urandom
; Set to {nocache,private,public} to determine HTTP caching aspects.
session.cache_limiter = nocache
; Document expires after n minutes.
session.cache_expire = 180
; use transient sid support if enabled by compiling with --enable-trans-sid.
session.use_trans_sid = 1
url_rewriter.tags = "a=href,area=href,frame=src,input=src,form=fakeentry"
一般需要修改的都列出了