Can't re-login after 'Session has timed out. Please log in again.'

Hello. What causes a session not being able to be started (can't login or re-login) regardless of the valid user when session timed out? I'm testing the installation and I've been switching between various logins, be it customer, agent, or root depending on what I'm testing. The new problem is that the message, 'Session has timed out. Please log in again.' is displayed, not allowing login nor re-login to neither 'customer.pl' nor 'index.pl' regardless of the user. This is the first time I've run into this. There are no records stored in the database's 'sessions' table. All logins are 'valid'. The system is still able to detect when a login is typed incorrectly. I can still 'create new customer account' via customer.pl, but can't login using it due to 'Session has timed out. Please log in again.' message. I always make sure there is no sessions id on the URL just to make sure it's not picking up an old session id from cache. I'm trying to avoid some of the traditional basic methods that could alleviate the problem via the backdoor, but I would like to know what may be causing the problem and what the recommended solution would be. I hope when this problem is solved, I can replicate it for a better understanding of this software. I'm testing it on a Unix FreeBSD system. Thanks.

Hello again. I believe I've found the solution or problem, depending on how you look at it. Here goes: When using the following (refer to 'Defaults.pm' re: SESSIONS): $Self->{SessionModule} = 'Kernel::System::AuthSession::IPC'; WITH... $Self->{TimeZone} = -4; which is US Eastern Daylight Savings time for a website whose servers are set to UTC (GMT+0) in order to accommodate customers internationally, the 'Kernel::System::AuthSession::IPC' module has in it the "CheckSessionID" subroutine' whereby it's 'if statement' will always be 'true'. Therefore, the session will always be 'timed out' based on this calculation. If someone knows how to fix, please reply. I haven't gotten that far... Thanks.

Hi! I don't have TimeZone defined in Defaults.pm or Config.pm and OTRS is using local time as default. Why are you using such setting for TimeZone? Maybe it would be a good idea to try "Kernel::System::AuthSession::FS", so OTRS will manage sessions by itself and hopefully you won't face this problem with the timezone. Regards, On 21 Apr 2005 at 0:04, s taylor wrote:
Hello again.
I believe I've found the solution or problem, depending on how you look at it. Here goes:
When using the following (refer to 'Defaults.pm' re: SESSIONS):
$Self->{SessionModule} = 'Kernel::System::AuthSession::IPC';
WITH...
$Self->{TimeZone} = -4;
which is US Eastern Daylight Savings time for a website whose servers are set to UTC (GMT+0) in order to accommodate customers internationally, the 'Kernel::System::AuthSession::IPC' module has in it the "CheckSessionID" subroutine' whereby it's 'if statement' will always be 'true'. Therefore, the session will always be 'timed out' based on this calculation.
If someone knows how to fix, please reply. I haven't gotten that far...
Thanks.
_______________________________________________ OTRS mailing list: otrs - Webpage: http://otrs.org/ Archive: http://lists.otrs.org/pipermail/otrs To unsubscribe: http://lists.otrs.org/cgi-bin/listinfo/otrs Support oder Consulting für Ihr OTRS System? => http://www.otrs.de/
--- Victor R. Rodriguez Departamento de Sistemas Valoraciones del Mediterraneo, S.A. ---

Thanks for your reply. I'm using the 'Timezone' parameter from 'Defaults.pm' because the webserver I'm installing this on has it's local time set to GMT+0 365 days per year. The webserver administrator's reasoning is, "it allows all clients located all over the world to remain unaffected by daylight savings in other countries. Any programs you have should be designed with an offset, so that you can alter the timezone to suit your location's timezone." The result is the time displayed on the OTRS screens is currently ahead by 4 hours relative to the US Eastern Daylight Savings time. In order to display EDT, the Timezone offset parameter in Defaults.pm (or Config.pm) must be set to '-4'. The problem with this is, it causes 'sub CheckSessionID' in 'Kernel::System::AuthSession::IPC' to test 'true' always, thus preventing login by all (admin, agents, and customers). This would also be the case when time goes back to Eastern Standard Time in the Fall, whereby the offset would be set to '-5'. For those in the Pacific timezone, this offset is even 'more negative' relative to GMT+0. In order for the 'CheckSessionID' subroutine to work in the US for all OTRS users when webservers are set to GMT+0 (which is occurring more and more), that calculation has to render 'false' in order to login. I'll look into 'FS' for sessions, but I haven't seen much info on what it is all about. I'd like to know why 'IPC' was chosen over 'FS' as 'default' in 'Defaults.pm' and whether it's because there may be a disadvantage to using 'FS' or whether it's webserver-configuration dependent. If you know, please let me know. I can then modify the displayed time in OTRS to display the time on OTRS screens to the eastern time zone. I'd have to look at the trying to get the tickets' time when submitted to display the eastern time zone versus again, GMT+0. Again, thanks for your response.

Hello again. I just looked at 'Kernel::System::AuthSession::FS' => 'sub CheckSessionID' => 'check session idle time'. It uses the same calculation as used in 'Kernel::System::AuthSession::IPC'. When tracing the code, the 'UserSessionStart' in 'sub CheckSessionID' is defined in both 'customer.pl' and 'index.pl' which references 'SystemTime()' which incorporates the 'Timezone' parameter in 'Kernel::System::Time.' CONCLUSION: Either a workaround or an alternative is needed for displaying US timezones when OTRS is running on a webserver whose localtime is set to GMT+0. This variation in timezones would also affect ticket submission; the respondent's times via web interface; log timestamps; etc. in those cases where the OTRS administrator would prefer to have all of the timestamps to be recorded in the timezone of choice. Thanks.

Hello again. Here is just a more detailed version of my initial assessment of the cause. Hopefully, it provides some usable information to the final solving of the LOGIN PROBLEM mystery. I believe the problem is located in the following 'equation portion' of the 'if' statement: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # check session idle time my $MaxSessionIdleTime = $Self->{ConfigObject}->Get('SessionMaxIdleTime'); if ( (time() - $MaxSessionIdleTime) >= $Data{UserLastRequest} ) { $Kernel::System::AuthSession::CheckSessionID = 'Session has timed out. Please log in again.'; This routine is located in the following packages: Kernel::System::AuthSession::IPC; Kernel::System::AuthSession::FS; and Kernel::System::AuthSession::DB. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The 'TimeZone offset' is incorporated in the both 'index.pl' and 'customer.pl' as it defines the 'UserLastRequest' calculated value from 'Kernel::System::Time->System()'. ~~~~~ Since the offset is incorported in the 'UserLastRequest' with respect to the webserver's localtime on the right-hand side of the above equation, and is used in calculating the 'idle time' which is based on the webserver's time in the future, this offset must be incorporated in the time parameter on the left-hand side of the equation so that they'll use the same 'time basis.' As the equation stands, the offset is NOT incorporated on the left-hand side. It only uses the 'raw time', "time()", not the 'corrected time', "time() + offset", as embedded in the equation below: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ time() - $MaxSessionIdleTime) >= $Data{UserLastRequest} ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Therefore, in using the equation above as is, since the timezone offset for the United States, e.g. Eastern time zone, is negative (-4 hrs or -5 hrs; converting to seconds) relative to a webserver whose local time is set at GMT+0, it makes the right-hand side 'equal to' or 'less than' the left-hand side by the value of the offset BEFORE the time has had a chance to elapse when calculating 'idle time.' Then, since the 'SessionMaxIdleTime' is set at 4 hrs., the test of the 'if' statement renders 'TRUE' as soon as the login 'submit' button is clicked. My guess is that time has probably only elapsed some fraction of a second, NOT a whole 1-second to render the statement 'FALSE.' In the strictest sense, as is, the equation is: "time() -14400 >= [time() + elapsed seconds] + (-14400)", whereby, the statement will always render 'TRUE' at login time when 'time()' on both sides of the equation are essentially equal since 'elapsed seconds' essentially equals '0'. This scenario for the Eastern timezone then becomes the point that represents an inflection point for the equation when the 'SessionMaxIdleTime' is set for 4 hrs (14400 sec).
From this, I would think the equation would work if the webserver time at the start is on the same 'basis' as the time at the end, before the 'idle time' is calculated. This would then be for the scenario described above as:
"time() + offset -14400 >= [time() + elapsed seconds] + offset" OR "time() + offset - $MaxSessionIdleTime >= $Data{UserLastRequest}" AND with the numbers mentioned above at login plugged into the equation, "time() -14400 -14400 >= [time() + elapsed second] + (-14400)", WHERE, elapsed seconds = '0' at login. Then, the equation boils down to... "-14400 >= 0", which renders 'FALSE' and allows SUCCESSFUL LOGIN!!! Hope this helps in finding the final solution.

Hello, There are some differences if you hadle sessions via IPC, FS or DB. The first one is possibly the fastest, as everything is in memory. FS is a bit slower (uses the harddisk) and DB is the slowest (but I suppose that it has any benefits over the other two ;) , but both allow you to maintain session states if your server goes down, allowing me to set it in a HA cluster. Regards, On 21 Apr 2005 at 10:35, s taylor wrote:
Thanks for your reply.
I'm using the 'Timezone' parameter from 'Defaults.pm' because the webserver I'm installing this on has it's local time set to GMT+0 365 days per year. The webserver administrator's reasoning is, "it allows all clients located all over the world to remain unaffected by daylight savings in other countries. Any programs you have should be designed with an offset, so that you can alter the timezone to suit your location's timezone."
The result is the time displayed on the OTRS screens is currently ahead by 4 hours relative to the US Eastern Daylight Savings time. In order to display EDT, the Timezone offset parameter in Defaults.pm (or Config.pm) must be set to '-4'.
The problem with this is, it causes 'sub CheckSessionID' in 'Kernel::System::AuthSession::IPC' to test 'true' always, thus preventing login by all (admin, agents, and customers). This would also be the case when time goes back to Eastern Standard Time in the Fall, whereby the offset would be set to '-5'. For those in the Pacific timezone, this offset is even 'more negative' relative to GMT+0.
In order for the 'CheckSessionID' subroutine to work in the US for all OTRS users when webservers are set to GMT+0 (which is occurring more and more), that calculation has to render 'false' in order to login.
I'll look into 'FS' for sessions, but I haven't seen much info on what it is all about. I'd like to know why 'IPC' was chosen over 'FS' as 'default' in 'Defaults.pm' and whether it's because there may be a disadvantage to using 'FS' or whether it's webserver-configuration dependent. If you know, please let me know.
I can then modify the displayed time in OTRS to display the time on OTRS screens to the eastern time zone. I'd have to look at the trying to get the tickets' time when submitted to display the eastern time zone versus again, GMT+0.
Again, thanks for your response.
--- Victor R. Rodriguez Departamento de Sistemas Valoraciones del Mediterraneo, S.A. ---

Thank you, Victor. Your info is very helpful.

Hello again. A session that prematurely times out may occur when using the 'Timezone' offset. Based on the numerical value of the offset, a session can be timed out via 'idle timeout' or other session-related activity 'error' BEFORE the 'real' elapsed time has been reached. For more detail and the solution, see Bug# 719 for the bug fix. Good Luck.

Hello. NOTE OF CAUTION: If you decide to implement the bugfix in Bug# 719 (re: the revised CVS files), another bug fix is still needed (see Bug# 734) for the complete solution. This new bug fix will actually be implemented in v. 2.0 beta2 therefore, I'm assuming NOT for v.1.3.2 if I interpret the response to Bug# 734 correctly. Take care.
participants (2)
-
s taylor
-
Victor Rodriguez Cortes