If no active session, start new one


/ Published in: PHP
Save to your folder(s)



Copy this code and paste it in your HTML
  1. <?php
  2. if (session_id() == "") session_start(); // if no active session we start a new one
  3. echo $_SESSION['user_logged'];
  4. ?>

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.