Note that there are some explanatory texts on larger screens.

plurals
  1. POsession not working between pages of different directories
    primarykey
    data
    text
    <p>I had been working on this issue since last two days, but still unable to solve.</p> <p>i had two script one in root directory where session registered and remain persistent when i access the page again, but when i am going to access the page from sub directory script suggest that no session is registered.</p> <p>detail explanation below : </p> <p>Problem is that when i start_session() from root directory script that is : <a href="http://www.kstreethome.com/test.php" rel="nofollow">http://www.kstreethome.com/test.php</a> it's working fine</p> <p>Code for /test.php </p> <pre><code>&lt;?php error_reporting(E_ALL); echo "This is session save path : " . session_save_path() . "&lt;/br&gt;"; //echo phpinfo(); if(!isset($_SESSION['User'])) { echo "Session not set &lt;/br&gt;"; session_start(); $_SESSION['User'] = "Hiren"; $_SESSION['AccessType'] = "U"; $_SESSION['UserType'] = "W"; $_SESSION['UserID'] = "123"; $_SESSION['DataUser'] = "Test"; $_SESSION['Password'] = "Test"; echo session_id(); echo $_SESSION['User']; echo $_SESSION['AccessType']; echo $_SESSION['UserType']; echo $_SESSION['UserID']; echo $_SESSION['DataUser']; echo $_SESSION['Password']; } else { echo "Session set &lt;/br&gt;"; echo $_SESSION['User']; echo $_SESSION['AccessType']; echo $_SESSION['UserType']; echo $_SESSION['UserID']; echo $_SESSION['DataUser']; echo $_SESSION['Password']; } ?&gt; </code></pre> <p>but</p> <p>when i start_session() from sub directory Ajax script that is : <a href="http://www.kstreethome.com/Ajax/test.php" rel="nofollow">http://www.kstreethome.com/Ajax/test.php</a> it's not working however in this script it is storing session and accessible in the same run but when i reload /Ajax/test.php the session is just destroyed and i have to start again.</p> <p>Code for /Ajax/test.php</p> <pre><code>&lt;?php error_reporting(E_ALL); echo "This is session save path : " . session_save_path() . "&lt;/br&gt;"; //echo phpinfo(); if(!isset($_SESSION['User'])) { echo "Session not set &lt;/br&gt;"; session_start(); $_SESSION['User'] = "Hiren"; $_SESSION['AccessType'] = "U"; $_SESSION['UserType'] = "W"; $_SESSION['UserID'] = "123"; $_SESSION['DataUser'] = "Test"; $_SESSION['Password'] = "Test"; echo session_id(); echo $_SESSION['User']; echo $_SESSION['AccessType']; echo $_SESSION['UserType']; echo $_SESSION['UserID']; echo $_SESSION['DataUser']; echo $_SESSION['Password']; } else { echo "Session set &lt;/br&gt;"; echo $_SESSION['User']; echo $_SESSION['AccessType']; echo $_SESSION['UserType']; echo $_SESSION['UserID']; echo $_SESSION['DataUser']; echo $_SESSION['Password']; } ?&gt; </code></pre> <p>the code is same in both file and it's for testing purpose</p> <p>another strange thing is that in root script /test.php it says session path '' that is default null as i had not changed defaults inn php.ini, but in the script /Ajax/test.php it says session save path is /tmp strange right?</p> <p>it is needless to say it works fine my local server but not on hosting server so please guide me in this issue.</p>
    singulars
    1. This table or related slice is empty.
    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.
 

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