This topic is locked

Session timeouts and wrong record from detail to master

11/24/2006 2:31:28 AM
PHPRunner General questions
rjks author

Morning
I am having problems with session expired.
Two things interest me:
1.I keep gettin session expired messages and after logging in again the last page, saved in $myURL, is displayed. However if I had a Master/Detail page before the session timeout the correct relationship is gone and all detail records in the table are displayed, which can be a problem as I have set only view own files in the advanced user settings. My workaround is, after a session time outalways load the menu page so that any filters will be reset. This is of course not the best solution as the user has to wander through the menu structures to reach the last used page.
And now to the question: How can I make sure the relationships are kept after a session timeout?
2. Returning to the master table always shows the first record as active, how can I ensure that I return to the correct Master record?
Thanks in advance for any help.
Robert Künkel-Smith

rjks author 11/25/2006

Hello Support??
I just don´t seem to have much luck with my questions, are they too simple, are they of no interest??
It always seems to reqire a send mail pointing to the first one before I get a responce.
It would be nice to get an answer.
Thanks anyway
Robert

Admin 11/27/2006

Robert,
I'm sorry for the delay with reply.

  1. The current Master record key value is kept in session variables.

    So when the session is timed out the key value is lost.
    You can try to save this value in URL or Cookies.
    I'm afraid there is no easy solution for this.

    The best way is to increase session timeout.
  2. I'm not sure what is "active" record. Please clarify.

rjks author 11/28/2006

Morning,
thank you for the reply.
I have already increased the session timeout. The CheckFileTime function doesn´t do anything, doesn´t reset the sesson, see below. There is no reason that a timeout should occour.
I am now checking step for step to find the exact point where the session becomes invalid, in each screen

the UserID, function

if(!@$_SESSION["UserID"])

, or rights,

CheckSecurity(@$_SESSION["OwnerID"],"Add"))

are checked and a session reset carried out when FALSE, but the session is still active with values.
I´ll just have to plod on and hope to find the reason.

With active I mean that when a reurn to master table is called that the master should be shown in the list.
Thanks again for the kind comments.
Robert

// clear session if file was changed

function CheckFileTime()

{

return;

if(!@$_SERVER["PATH_TRANSLATED"])

return;

$time=filemtime($_SERVER["PATH_TRANSLATED"]);

if(@$_SESSION[$_SERVER["PATH_TRANSLATED"]."_filetime"] && $time!=$_SESSION[$_SERVER["PATH_TRANSLATED"]."_filetime"])

session_unset();

$_SESSION[$_SERVER["PATH_TRANSLATED"]."_filetime"]=$time;

}
Admin 11/28/2006

Robert,
looks like there is something wrong with PHP sessions at your server.
You need to set up PHP sessions properly or completely reinstall PHP.

Here is the article that may help you with this.

http://www.webcheatsheet.com/php/install_and_configure.php
Also you may need to contact your system administrator to find if there are some requirements on using sessions at your server.
Digging the PHPRunner code wouldn't help you with this.
After the sessions start working at your server the Master List page will remember the last opened page so when the user clicks Back to master he will see the desired master table record.