×
Home About Us Products Services News Free Scripts Contact
news php scripts and software

PHP example - How to create a SESSION variable?


PHP - How to create a SESSION variable?

The sessions in PHP are very useful to pass data through the pages, (as http is stateless protocol). At every session is associated a unique session ID which can be stored on a user's computer or in a cookie or passed along through a URL.

<?php
session_start(); // must be called before anything is output to the browser 

$userEmail = "whatever@whatever.com"; 

$_SESSION["userEmail"] = $userEmail; 

...

?>

Category: PHP

 
<< Go back