how create and display data with php session code example
Example 1: destroy session php
<?php
session_start();
session_destroy();
unset($_SESSION['username']);
?>
Example 2: php session variables
<?php
session_start();
$_SESSION['var'];
?>
Example 3: can we acces session variable in two files
<?php
session_start();
...
if($responseCode == 1) {
$_SESSION['card_id'] = $_POST['card_id'];
$_SESSION['password'] = $_POST['password'];
print '<script type="text/javascript">';
print 'window.location = "http://domain.com/File2.php";';
print '</script>';
}
?>