使用PHP session_decode()而不将会话变量添加到自己的会话

I have a PHP script that uses session_decode to get the session variables of customer's session (from session stored file). The problem is that whenever I call the script and it reads the session variables, it also add them to my own session. Is there a way to avoid this or maybe use a better method to get the customer's session information without using session_decode?

Thanks

I think I have found the simplest solution/workaround:

<?php
// if session is not started
session_start();

// store our current session
$my_sess = $_SESSION;

// decode $data (the encoded session data, either from a file or database). Remember, decoded data is put directly into $_SESSION
session_decode($data);
$data = $_SESSION;

print_r($data);

// restore our own session
$_SESSION = $my_sess;

?>