PHP5中SESSION路径配置详解
本文章来告诉你如何在php5中的php.ini中配置session的详细教程,包括了路径等等一些相关的操作,有需要了解的同学可参考一下。
php.ini中有关session的一些设定会影响到session函数的使用,以php5版本为例,我们来了解一下php.ini中有关session的设定。
;处理session存取的模式(预设:files)
session.save_handler = files
;session档案存放路径(预设:/tmp)
session.save_path = /tmp
;session使用cookie的功能(预设:启动 1)
session.use_cookies = 1
;session的名字(预设:PHPSESSID)
session.name = PHPSESSID
;自动启动(预设:关 0,此处可以改为1)
session.auto_start = 0
;session使用cookie的生存期,以秒为单位(预设:随浏览器关闭而消失 0)
session.cookie_lifetime = 0
;session使用cookie的路径(预设:与domian相同或根路径 /)
session.cookie_path = /
;session使用cookie的域名称(预设:空)
session.cookie_domain =
;处理连续资料的方式,本功能只有WDDX模组或PHP内部使用(预设:php)
session.serialize_handler = php
;按千分之一的比率进行垃圾收集
;垃圾收集的处理几率(预设:1)
session.gc_probability = 1
;设置进程比率,(php5新增参数,预设:1000)
session.gc_divisor = 1000
;(垃圾收集)被处理前的生存期(预设:1440[秒])
session.gc_maxlifetime = 1440
;PHP 4.2和以前的版本都有个BUG,即使你禁止了”允许注册全局变量”.仍然可以让你在全局变量范围中初始化一个SESSION的值
;PHP 4.3 和以后的版本会发出相应的警告,你可以禁止警告.PHP5中,只有你打开了bug_compat_42(=ON),警告才会显示.
session.bug_compat_42,0
session.bug_compat_warn = 1
;session在重新整理时检查session是否还存在(预设:空)
session.referer_check =
;特别设定session值的长度(预设:关)
session.entropy_length = 0
;特别设定session值的文件
session.entropy_file =
;使用cache限制器(预设:不要cache)
session.cache_limiter = nocache
;使用cache的生存期
session.cache_expire = 180
;使用sid值(session_id)传送模式(基于安全,预设:关)
session.use_trans_sid = 0
;选择一个HASH函数,0为MD5(128比特强度),1为SHA-1(160比特强度)
session.hash_function = 0
;定义当转换2进制hash数据为一些可读的数据时,每个字符存储多少个比特.
;4 比特: 0-9, a-f
;5 比特: 0-9, a-v
;6 比特: 0-9, a-z, A-Z, “-”, “,”
session.hash_bits_per_character = 5
;URL重指向的标签
url_rewriter.tags = “a=href,area=href,frame=src,input=src,form=fakeentry”
对以上设置进行修改以后应该重启Apache服务器,以加载以上的修改。
配置session其实不难只要大家好好仔细的看看就KO了。

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

SublimeText3 English version
Recommended: Win version, supports code prompts!

SecLists
SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.

Dreamweaver CS6
Visual web development tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Mac version
God-level code editing software (SublimeText3)
