Several supplementary functions about session (2)_PHP tutorial

WBOY
Release: 2016-07-13 17:21:54
Original
796 people have browsed it

//************************************
session_get_cookie_params (PHP4 $#@62;= 4.0RC2)
array session_get_cookie_params (void);
Returns an array that records some information about the cookies of the current session.
There are:
"lifetime" - the lifetime of the cookie.
"path" - The path where the cookie is saved.
"domain" - The domain of the cookie.
//*****************************
session_set_cookie_params (PHP4 $#@62;= 4.0b4 )
void session_set_cookie_params (int lifetime [, string path [, string domain]])
Set some parameters of the session cookie, similar to the settings in php.ini, but the settings made by this function are only for The current script file is valid.
//************************************
The function to be introduced below should be useful to everyone Very useful, are you interested in customizing a session that does not require cookies to be saved? This function can realize your idea.
Let me think about it, what are the benefits of not using cookies? At least, you don't have to worry about whether the client's cookie function is turned on, right?
session_set_save_handler (PHP4 $#@62;= 4.0b4)
void session_set_save_handler (string open, string close, string read, string write, string destroy, string gc)
This function can define user-level sessions Save functions (open, close, write, etc.).
For example, this function is very useful when we want to save the session in a local database.

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/532388.htmlTechArticle//************************ ********** session_get_cookie_params (PHP4 $#@62;= 4.0RC2) array session_get_cookie_params (void); Returns an array that records some of the cookies of the current session...
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!