Sunday, February 1, 2015

Check if PHP session already started? session_start check

Simplest way to check if PHP session has already started or not


<?php
  if (!isset ($_COOKIE[ini_get('session.name')])) {
    session_start();
  }
?>

No comments:

Post a Comment