Horje Website
Session time set – PHP Code

Create a file set-session.php and set value and lifetime.

 

 
 
  1. <?php
  2. session_start();
  3. //Set PHP session with value, time
  4. $currentTime = time();
  5. $_SESSION['color'] = array(
  6. "value" => "blue",
  7. "time" => $currentTime,
  8. "life_time" => 5
  9. );
  10. ?>

 

Source: phppot.com

Published:
December 20, 2022
Author:
admin
Category:
PHP Source Code
Views:
28

This article was posted in PHP Source Code. Bookmark the permalink. Follow comments with the RSS feed for this post.Post a Comment or leave a trackback: Trackback URL.

Leave a Reply

Your email address will not be published. Required fields are marked *

 

Horje © 2011 - 2023