Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Well the Information in <code>$_SESSION</code> is just stored as a serialized string on the disk. (If you don't use something like memcached session storage)</p> <p>So reading in that file, unserializing it's contents, changing the appropriate values and then serializing it back should be pretty much everything you need.</p> <hr> <p>If you don't want to deal with that you could set the <code>session_id()</code> before <code>session_start()</code>, then edit the values using php and then call <code>session_write_close()</code> to store it on disk again.</p> <hr> <p>Sample script for the session id:</p> <pre><code>&lt;?php session_id("838c4dc18f6535cb90a9c2e0ec92bad4"); session_start(); var_dump($_SESSION); $_SESSION["a"] = "foo"; session_write_close(); </code></pre> <p>Sample script for the unserialisation (<a href="http://www.php.net/manual/en/function.unserialize.php#44837" rel="nofollow">function taken from the comments on the unserialze php.net page</a>)</p> <pre><code>&lt;?php session_save_path("./session"); session_start(); $_SESSION["x"] = 1; $id = session_id(); var_dump($id); session_write_close(); $session = file_get_contents("./session/sess_$id"); var_dump($session); function unserialize_session_data( $serialized_string ) { $variables = array( ); $a = preg_split( "/(\w+)\|/", $serialized_string, -1, PREG_SPLIT_NO_EMPTY | PREG_SPLIT_DELIM_CAPTURE ); for( $i = 0; $i &lt; count( $a ); $i = $i+2 ) { $variables[$a[$i]] = unserialize( $a[$i+1] ); } return( $variables ); } var_dump(unserialize_session_data($session)); </code></pre> <p>Putting it back together isn't hard ether.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload