SESSION path configuration in PHP5 _ PHP Tutorial

Source: Internet
Author: User
SESSION path configuration in PHP5. This article will show you how to configure session details in php. ini in php5, including Path and other related operations. For more information, see. Php. this article tells you how to use php in php5. detailed tutorial on configuring session in ini, including Path and other related operations. For more information, see.

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_pisor = 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.

Bytes. Php. ini...

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.