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

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

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

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

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

Hot Topics



Title: The working principle and configuration method of GDM in Linux systems In Linux operating systems, GDM (GNOMEDisplayManager) is a common display manager used to control graphical user interface (GUI) login and user session management. This article will introduce the working principle and configuration method of GDM, as well as provide specific code examples. 1. Working principle of GDM GDM is the display manager in the GNOME desktop environment. It is responsible for starting the X server and providing the login interface. The user enters

1. How can you make money by publishing articles on Toutiao today? How to earn more income by publishing articles on Toutiao today! 1. Activate basic rights and interests: original articles can earn profits by advertising, and videos must be original in horizontal screen mode to earn profits. 2. Activate the rights of 100 fans: if the number of fans reaches 100 fans or above, you can get profits from micro headlines, original Q&A creation and Q&A. 3. Insist on original works: Original works include articles, micro headlines, questions, etc., and are required to be more than 300 words. Please note that if illegally plagiarized works are published as original works, credit points will be deducted, and even any profits will be deducted. 4. Verticality: When writing articles in professional fields, you cannot write articles across fields at will. You will not get appropriate recommendations, you will not be able to achieve the professionalism and refinement of your work, and it will be difficult to attract fans and readers. 5. Activity: high activity,

A file path is a string used by the operating system to identify and locate a file or folder. In file paths, there are two common symbols separating paths, namely forward slash (/) and backslash (). These two symbols have different uses and meanings in different operating systems. The forward slash (/) is a commonly used path separator in Unix and Linux systems. On these systems, file paths start from the root directory (/) and are separated by forward slashes between each directory. For example, the path /home/user/Docume

Windows operating system is one of the most popular operating systems in the world, and its new version Win11 has attracted much attention. In the Win11 system, obtaining administrator rights is an important operation. Administrator rights allow users to perform more operations and settings on the system. This article will introduce in detail how to obtain administrator permissions in Win11 system and how to effectively manage permissions. In the Win11 system, administrator rights are divided into two types: local administrator and domain administrator. A local administrator has full administrative rights to the local computer

Understanding Linux Bashrc: Function, Configuration and Usage In Linux systems, Bashrc (BourneAgainShellruncommands) is a very important configuration file, which contains various commands and settings that are automatically run when the system starts. The Bashrc file is usually located in the user's home directory and is a hidden file. Its function is to customize the Bashshell environment for the user. 1. Bashrc function setting environment

Detailed explanation of division operation in OracleSQL In OracleSQL, division operation is a common and important mathematical operation, used to calculate the result of dividing two numbers. Division is often used in database queries, so understanding the division operation and its usage in OracleSQL is one of the essential skills for database developers. This article will discuss the relevant knowledge of division operations in OracleSQL in detail and provide specific code examples for readers' reference. 1. Division operation in OracleSQL

What is the difference in the "My Computer" path in Win11? Quick way to find it! As the Windows system is constantly updated, the latest Windows 11 system also brings some new changes and functions. One of the common problems is that users cannot find the path to "My Computer" in Win11 system. This was usually a simple operation in previous Windows systems. This article will introduce how the paths of "My Computer" are different in Win11 system, and how to quickly find them. In Windows1

The modulo operator (%) in PHP is used to obtain the remainder of the division of two numbers. In this article, we will discuss the role and usage of the modulo operator in detail, and provide specific code examples to help readers better understand. 1. The role of the modulo operator In mathematics, when we divide an integer by another integer, we get a quotient and a remainder. For example, when we divide 10 by 3, the quotient is 3 and the remainder is 1. The modulo operator is used to obtain this remainder. 2. Usage of the modulo operator In PHP, use the % symbol to represent the modulus
