how append new entry in different session
<p>the problem I am experimenting is about this code:</p>

<pre><code>&lt;?php

    session_start();
    /* ... */

    if(!array_key_exists('entries', $_SESSION) || array_key_exists('reset', $_GET))
    {
        $_SESSION['entries'] = array();
    }

    $_SESSION['entries'][] = array("name" =&gt; $_GET["name"]);

    // json
    $json_string = json_encode($_SESSION['entries']);

    //file
    $newfile="location.json";
    $file = fopen ($newfile, "w");
    fwrite($file, $json_string);
    fclose ($file);
    ?&gt; 
</code></pre>

<p>The script get te POST variables, encode them in json format and save to a file, appending new  entries to the file.
It works well, but when I start a new session, the file is overwrited, and start again from empty.</p>

<p>Any help?</p>
