Question : create session in php
Answered by : ankur-prajapati
<?php // Start the session session_start(); // Set session variables $_SESSION["color"]= "blue"; $_SESSION["animal"]= "dog"; echo "The session variable are set up.";
?>
Source : | Last Update : Tue, 23 Jun 20
Question : new session php
Answered by : tame-tuatara-q2g4zzbdsxwd
Creating New Session
==========================
<?php
session_start();
/*session is started if you don't write this line can't use $_Session global variable*/
$_SESSION["newsession"]=$value;
?>
Getting Session
==========================
<?php
session_start();
/*session is started if you don't write this line can't use $_Session global variable*/
$_SESSION["newsession"]=$value;
/*session created*/
echo $_SESSION["newsession"];
/*session was getting*/
?>
Updating Session
==========================
<?php
session_start();
/*session is started if you don't write this line can't use $_Session global variable*/
$_SESSION["newsession"]=$value;
/*it is my new session*/
$_SESSION["newsession"]=$updatedvalue;
/*session updated*/
?>
Deleting Session
==========================
<?php
session_start();
/*session is started if you don't write this line can't use $_Session global variable*/
$_SESSION["newsession"]=$value;
unset($_SESSION["newsession"]);
/*session deleted. if you try using this you've got an error*/
?>
Reference: http://gencbilgin.net/php-session-kullanimi.html
Source : https://www.php.net/manual/en/reserved.variables.session.php | Last Update : Sun, 23 Jan 22
Question : $_SESSION php example
Answered by : elated-eagle-yuraznfn5whn
<?php
session_start();
echo session_id();
?>
Source : https://code.tutsplus.com/tutorials/how-to-use-sessions-and-session-variables-in-php--cms-31839 | Last Update : Mon, 08 Mar 21
Question : php how to make a session
Answered by : nic-4ootxadb06ao
<input type="text" class="form-control" id="firstNameInput" name="firstNameInput" placeholder="First Name" value="{{ Session::has('firstName') ? Session::get('firstName') : old('firstNameInput') }}" />
Source : | Last Update : Thu, 04 Aug 22