Jump to content

[SOLVED] $_SESSION


Kano

Recommended Posts

Something like this, maybe:

<?php
function sessionReset($keysToKeep) {
  // hold your temp values
  $temp = array();
  if (is_array($keysToKeep)) {
    foreach ($keysToKeep as $k => $v) {
      $temp[$k] = $v;
    }
  }

  // Clear session
  unset($_SESSION);
  $_SESSION = array();

  // assign temp back to session
  if (count($temp) > 0) {
    foreach ($temp as $k => $v) {
      $_SESSION[$k] = $v;
    }
  }
}

// Reset your session:
sessionReset(array('auth', 'wscemail'));
?>

Link to comment
https://forums.phpfreaks.com/topic/42991-solved-_session/#findComment-208788
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.