Home >Backend Development >PHP Problem >How to modify session value in php

How to modify session value in php

青灯夜游
青灯夜游Original
2021-03-17 17:59:323250browse

php method to modify the session value: 1. In the PHP file, use the "ini_set('option', 'value'); statement to modify the value; 2. Use the specific function function session_set_cookie_params() to modify the value .

How to modify session value in php

The operating environment of this tutorial: windows7 system, PHP7.1 version, DELL G3 computer

Method 1: In the program Setting, use the ini_set() function to modify (valid only within the script cycle after setting)

session_start();
ini_set('选项', '值');

Method 2: Use a specific function to complete the setting

session_set_cookie_params(有效期, 有效路径,有效域,是否仅安全传输,是否HTTPONLY)

How to modify session value in php

Recommended learning: "PHP Video Tutorial"

The above is the detailed content of How to modify session value in php. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn