1

I'm working on my website with frames and sessions. It has 1 frame, where all session data is displayed, and 2 other frames with just random stuff. After time passes session data stops displaying and it starts to work properly again only when i'm going to my test page manually, like "mydomain.com/test.php" and THEN coming back to "mydomain.com". And this "test.php" page is only echo'ing one of my many sessions. It does not fixes if i just go to random page, that does not use sessions. Here is ALL that i have in my test.php, to give you a better idea:

session_start();
echo $_SESSION['oneofmanysessions'];

How can i fix this?
P.S. Sorry for bad english ._.

My index.php page:

<?php
session_start();
?>

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">
    <html>
     <head>
      <meta http-equiv="Content-Type" content="text/html; charset="utf-8">
      <link rel="shortcut icon" href="images/icon.ico" />

     </head>
     <frameset rows="12%,*" bordercolor="black" >
       <frame src="menu.php" name="MENU" scrolling="no" noresize>
       <frameset cols="*,13%" bordercolor="black">
         <frame src="main.php" name="MAIN" scrolling="no" noresize  >
         <frame src="details.php" name="DETAILS" scrolling="no" noresize>
       </frameset>
     </frameset>
    </html>

1 Answers1

0

A session in PHP only has a default lifetime of 24 minutes, so depending on other activity (which results in whether the session garbage collector is run), your sessions may expire after that time. This require a file system that keeps track of the last access time for a session, and if your file system does not - the session will expire unless written again.

This is documented in the manual under session.gc_maxlifetime, and you might also want to read a good write-up about session in PHP under the question "How do I expire a PHP session after 30 minutes?".

Community
  • 1
  • 1
MatsLindh
  • 49,529
  • 4
  • 53
  • 84