What is a session? A session is basically a way of storing variables and making them available across multiple pages on your web site. We use the PHP super global $_SESSION to hold it. Eg: $_SESSION['variable'] <?php // begin the session session_start (); // set the value of the session variable $_SESSION [ 'hello' ]= 'sudhir' ; ?> We can retriew this value on another page by this <?php // begin our session session_start (); // echo the session variable echo 'The value of hello is ' . $_SESSION [ 'hello' ] ; ?> What should I do to destroy a whole session? ...
Coding Cheatsheets - Learn web development code and tutorials for Software developers which will helps you in project. Get help on JavaScript, PHP, XML, and more.