Answers for "starting a session in php"

PHP
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
4

php session variables

<?php
   session_start();
   $_SESSION['var'];
?>
Posted by: Guest on March-18-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
0

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>';
  }
?>
Posted by: Guest on August-13-2020

Browse Popular Code Answers by Language