Home > Backend Development > PHP Tutorial > Introduction to PHP session processing related functions [Part 1]

Introduction to PHP session processing related functions [Part 1]

WBOY
Release: 2016-07-25 08:51:13
Original
850 people have browsed it
PHPHandling session functions 1, session_start
Function function: Start a session or return an existing session.
Function prototype: boolean session_start(void);
Return value: Boolean value
Function description: This function has no parameters, and the return value is true. It is best to put this function first, and there cannot be any output before it, otherwise an alarm will be issued, such as: Warning: Cannot send session cache limiter headers already sent (output started at/ usr/local/apache/htdocs/cga/member/1.php:2) in/usr/local/apache/htdocs/cga/member/1.php on line 3
PHP Processing session functions 2, session_register
Function function: Register a new variable as a session variable
Function prototype: boolean session_register( string name);
Return value: Boolean value.
Function description: This function adds a variable to the current SESSION in the global variable. The parameter name is the name of the variable you want to add, and it will be returned if successful. Logical value true. You can use the form $_SESSION[name] or $HTTP_SESSION_VARS[name] to get or assign a value.
PHPHandling session functions 3, session_is_registered
Function functions: Checks whether the variable is registered as a session variable.
Function prototype: boobean session_is_registered(string name);
Return value: Boolean value
Function description: This function can check the current session Whether the specified variable has been registered in , the parameter name is the variable name to be checked. If successful, the logical value true is returned.
PHPHandling session functions 4, session_unregister
Function function: deleted Registered variables.
Function prototype: boolean session_session_unregister(stringname);
Return value: Boolean value
Function description: This function is in the current session Delete the global Variables within variables. The parameter name is the name of the variable to be deleted. If successful, it returns true.
PHPProcessing session functions5session_destroy
Function functions: End the current session and clear all resources in the session.
Function prototype: boolean session destroy(void);
Return value: Boolean value.
Function description: This function ends the current session. This function has no parameters, and the return value is true.

Get LAMP Brothers’ original PHP tutorial CD/"Essential PHP in Details" for free. For details, please contact the official website customer service: http://www.lampbrother.net
PHPCMSSecondary development http:/ /yun.itxdl.cn/online/phpcms/index.php?u=5
WeChat development                                                     
Mobile Internet Server Side Development http://yun.itxdl.cn/online/server/index.php?u=5
Javascript
Course http://yun .itxdl.cn/online/js/index.php?u=5
CTO
Training Camp                                                    

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