Home > Backend Development > PHP Tutorial > Beginner: How to use Session in PHP development? _PHP Tutorial

Beginner: How to use Session in PHP development? _PHP Tutorial

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-07-13 17:30:03
Original
937 people have browsed it

How to use Session?


//Must be added before use;
session_start();
?>
//Consider we have When considering whether to write session
if (isset($_POST[userid])){
//If you really agree to write:
$_SESSION[userid] = $ccdot

}else{
//or return cannot be written to session
}
?>


When you want to clear:

session_start();
unset($_SESSION[userid]); //OR : session_register(username);

The main function of the session_unregister() function is to unregister the current A session variable. But please note that if you use $HTTP_SESSION_VARS or $_SESSION on the current page

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/509208.htmlTechArticleHow to use Session? ?php //Must be added before use; session_start(); ? ?php // Consider that we sometimes consider whether to write session if(isset($_POST[userid])){ //If we really agree to write...
Related labels:
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