Exemple #1
0
 /**
  * No more changes in session expected.
  * Unblocks the sessions, other scripts may start executing in parallel.
  */
 public static function write_close()
 {
     if (self::$sessionactive) {
         session_write_close();
     } else {
         if (session_id()) {
             @session_write_close();
         }
     }
     self::$sessionactive = false;
 }
Exemple #2
0
 /**
  * No more changes in session expected.
  * Unblocks the sessions, other scripts may start executing in parallel.
  */
 public static function write_close()
 {
     if (version_compare(PHP_VERSION, '5.6.0', '>=')) {
         // More control over whether session data
         // is persisted or not.
         if (self::$sessionactive && session_id()) {
             // Write session and release lock only if
             // indication session start was clean.
             session_write_close();
         } else {
             // Otherwise, if possibile lock exists want
             // to clear it, but do not write session.
             @session_abort();
         }
     } else {
         // Any indication session was started, attempt
         // to close it.
         if (self::$sessionactive || session_id()) {
             session_write_close();
         }
     }
     self::$sessionactive = false;
 }