Some session settings in php. ini affect the use of the session function. Take the php5 version as an example to learn about the session settings in php. ini.
; Processing session access mode (default: files)
Session. save_handler = files
; Session file storage path (default:/tmp)
Session. save_path =/tmp
; Session uses the cookie function (default: Start 1)
Session. use_cookies = 1
; Session name (default: PHPSESSID)
Session. name = PHPSESSID
; Automatic start (default value: 0, which can be changed to 1)
Session. auto_start = 0
; Session uses cookie lifetime, in seconds (default: 0 disappears as the browser closes)
Session. cookie_lifetime = 0
; Session uses the cookie path (default: same as domian or root path /)
Session. cookie_path =/
; Session uses the cookie domain name (default: Null)
Session. cookie_domain =
; Processing of continuous data, this function is only used inside the WDDX module or PHP (default: php)
Session. serialize_handler = php
; Collect garbage at a rate of 1 ‰
; The probability of garbage collection (default: 1)
Session. gc_probability = 1
; Set the process rate (php5 new parameter, default: 1000)
Session. gc_divisor = 1000
; (Garbage collection) the lifetime before processing (preset: 1440 [seconds])
Session. Gc_maxlife time = 1440
PHP 4.2 and earlier versions both have a BUG. Even if you disable "allow registration of global variables", you can still initialize a SESSION value in the global variable range.
PHP 4.3 and later versions will issue a warning. You can disable the warning. In PHP5, the warning will only be displayed if you open bug_compat_42 (= ON.
Session. bug_compat_42, 0
Session. bug_compat_warn = 1
; When the session is reorganized, check whether the session still exists (default: Null)
Session. referer_check =
In particular, set the length of the session value (default: off)
Session. entropy_length = 0
Files with special session values
Session. entropy_file =
; Use the cache limiter (default: Do not cache)
Session. cache_limiter = nocache
; The lifetime of the cache.
Session. cache_expire = 180
; Use the sid value (session_id) transfer mode (based on security, default: off)
Session. use_trans_sid = 0
; Select a HASH function, 0 is MD5 (128 bits intensity), 1 is SHA-1 (160 bits intensity)
Session. hash_function = 0
Defines how many bits are stored for each character when the binary hash data is converted to some readable data.
; 4 bits: 0-9, a-f
; 5 bits: 0-9, a-v
; 6 bits: 0-9, a-z, A-Z, "-", ","
Session. hash_bits_per_character = 5
; URL re-pointing label
Url_rewriter.tags = "a = href, area = href, frame = src, input = src, form = fakeentry"
After modifying the preceding settings, restart the Apache server to load the preceding modifications.
It is not difficult to configure the session as long as you take a closer look at it.