Answers for "php sesion"

PHP
5

destroy session php

<?php 
 session_start(); // start session
 session_destroy();  // Delete whole session
// OR
unset($_SESSION['username']); // delete any specific session only
?>
Posted by: Guest on June-15-2020
0

echo session

print_r($_SESSION);
Posted by: Guest on September-14-2020
0

session php

<?php
// start session before any HTML
session_start();

// create some variales in $_SESSION
$_SESSION['name'] = 'myname';
$_SESSION['surname'] = 'mysurname';
$_SESSION['age'] = 24;
?>

<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8" />
        <title>My page</title>
    </head>
    <body>
    <p>
        Hey <?php echo $_SESSION['name']; ?> !<br />
        How are you today ?
    </p>
Posted by: Guest on February-10-2021

Browse Popular Code Answers by Language