Answers for "how to create a session"

PHP
0

how to start a session

<?php 
session_start(); //starts session
session_unset(); // remove all session variables
session_destroy(); // destroy the session
?>
Posted by: Guest on September-02-2021
3

create session in php

<?php 
  // Start the session
  session_start();

  // Set session variables
  $_SESSION["color"]= "blue";
  $_SESSION["animal"]= "dog";
  echo "The session variable are set up.";
?>
Posted by: Guest on June-16-2020
-1

session start php

<?php
// This sends a persistent cookie that lasts a day.
session_start([
    'cookie_lifetime' => 86400,
]);
?>
Posted by: Guest on April-17-2020

Code answers related to "how to create a session"

Browse Popular Code Answers by Language