Answers for "set session id php"

PHP
0

php session regenerate id

<?php
session_start();

$old_sessionid = session_id();

session_regenerate_id();

$new_sessionid = session_id();

echo "Old Session: $old_sessionid<br />";
echo "New Session: $new_sessionid<br />";
?>
Posted by: Guest on May-05-2020
0

set value in session php

session_start();
// Set session variables
$_SESSION["favcolor"] = "green";
$_SESSION["favanimal"] = "cat";
echo "Session variables are set.";
Posted by: Guest on April-11-2022

Browse Popular Code Answers by Language