Registering a variable by including it in $_SESSION : _SESSION « Cookie Session « PHP






Registering a variable by including it in $_SESSION

 
<?php
session_start(  );
$_SESSION['hello'] = 'Hello World';
echo $_SESSION['hello'];
?>
  
  








Related examples in the same category

1.Count Visits with session
2.Counting page accesses with a session
3.Implementing Sessions
4.Printing session data
5.Session based counter
6.Session preferences
7.Session using the proper $_SESSION super global
8.Verifying session info
9.check for a valid login in sessions
10.create_session_variable.php
11.delete_session_variable.php
12.Doing something special for a logged in user
13.Setting Up Cookie Authentication