есть такая функция, может поможет
/**
* Wraps around $_SESSION
*
* @param string $name name of session variable to set
* @param mixed $value value for the variable. Set this to null to unset the variable from the session.
*
* @return mixed value for the session variable
*/
function session($name, $value = null) {
static $session_active = false;
if ($session_active === false) {
if (($current = ini_get('session.use_trans_sid')) === false)
exit('Calls to session() requires [session.use_trans_sid] to be set');
$test = "mix{$current}{$current}";
$prev = @ini_set('session.use_trans_sid', $test);
$peek = @ini_set('session.use_trans_sid', $current);
if ($peek !== $current && $peek !== false)
session_start();
$session_active = true;
}
if (func_num_args() === 1)
return (isset($_SESSION[$name]) ? $_SESSION[$name] : null);
if ($value === null)
unset($_SESSION[$name]);
else
$_SESSION[$name] = $value;
}