Details on setting parameters of session in the configuration file of PHP5

  • 2020-05-05 11:00:22
  • OfStack

; Mode for handling session access (default: files)
session.save_handler = files

; session file storage path (default: /tmp)
session.save_path = /tmp

; session USES the functionality of cookie (default: start 1)
session.use_cookies = 1

; Name of session (default: PHPSESSID)
session.name = PHPSESSID

; Auto start (default: off 0, can be changed to 1 here)
session.auto_start = 0

; session USES the lifetime of cookie, in seconds (default: disappears with browser close 0)
session.cookie_lifetime = 0

; session USES cookie's path (default: same as domian or root path /)
session.cookie_path = /

; session USES cookie's domain name (default: empty)
session.cookie_domain =

; For processing continuous data, this feature is only used internally by WDDX module or PHP (default: php)
session.serialize_handler = php

; Garbage collection
at a rate of one thousandth ; Garbage collection probability (default: 1)
session.gc_probability = 1
; Set the process ratio, (php5 new parameter, preset: 1000)
session.gc_divisor = 1000

; Lifetime before disposal (default: 1440[s])
session.gc_maxlifetime = 1440

; PHP 4.2 and previous versions have an BUG, which allows you to initialize an SESSION value,
, in the global variable range, even if you disable "allow global variable registration" ; PHP 4.3 and later versions will issue warnings that you can disable.PHP5 will not display.
until you have bug_compat_42(=ON) turned on session. bug_compat_42, 0
session.bug_compat_warn = 1

; session checks to see if session still exists (default: empty)
when rearranging session.referer_check =

; Specify the length of the session value (default: off)
session.entropy_length = 0

; File
with session value specifically set session.entropy_file =

; Use cache limiter (default: no cache)
session.cache_limiter = nocache

; Lifetime using cache
session.cache_expire = 180

; Use sid values (session_id) in transfer mode (security based, default: off)
session.use_trans_sid = 0

; Select an HASH function,0 is MD5(128 bit strength),1 is SHA-1 (160 bit strength)
session.hash_function = 0

; Defines how many bits per character are stored when converting binary hash data to something readable.
; 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 redirects the label
url_rewriter. tags = "a = href, area = href, frame = src, input = src, form = fakeentry"

Remember to restart the Apache server.

Related articles: