Page 1 of 1

Session Timeout

Posted: Wed May 06, 2009 1:46 am
by softstor
Script URL: http://www.support.monitorlisting.com/
Version of script: 2.0
Hosting company: Hostrazer
URL of phpinfo.php: http://www.monitorlisting.com/phpinfo.php
URL of session_test.php: http://www.monitorlisting.com/session_test.php

Write your message below:

I did a new installation of the script. When I try to login I receive an error that the session has expired. I am unable to login. Here are some details of my hosting account:

PHP: 5.2.8
MySql: 5.0.67 Community

When I try to run phpinfo.php nothing is displayed.

Does anyone have any idea what the problem may be?

Posted: Wed May 06, 2009 6:18 am
by softstor
I think the host has Safe Mode turned ON. Would this cause a problem with the script?

Posted: Wed May 06, 2009 8:56 am
by Klemen
Try two things:

1. open the "common.inc.php" file inside "inc" folder in Notepad and change this code:

Code: Select all

function hesk_session_regenerate_id() {

    if (version_compare(phpversion(),'4.3.3','>='))
    {
       session_regenerate_id();
    }
    else
    {
        $randlen = 32;
        $randval = '0123456789abcdefghijklmnopqrstuvwxyz';
        $random = '';
        $randval_len = 35;
        for ($i = 1; $i <= $randlen; $i++)
        {
            $random .= substr($randval, rand(0,$randval_len), 1);
        }

        if (session_id($random))
        {
            setcookie(
                session_name('HESK'),
                $random,
                ini_get('session.cookie_lifetime'),
                '/'
            );
            return true;
        }
        else
        {
            return false;
        }
    }

}
to this:

Code: Select all

function hesk_session_regenerate_id() {
 return true;
}
Close all browser windows then try again and see if it helps.

If not try downloading the hesk_settings.inc.php file from your server, open in Notepad and change

Code: Select all

$hesk_settings['debug_mode']=0;
to

Code: Select all

$hesk_settings['debug_mode']=1;
Again close all browser Windows, try to login and see if you get any new errors or warnings.

Posted: Wed May 06, 2009 1:20 pm
by softstor
Thanks changing the function seems to solve the problem. Should I exect any other issues with safe mode turned on?

Posted: Wed May 06, 2009 2:30 pm
by Klemen
Not that I know of and I'm not sure this is a safe mode problem, but for some reason (not known to me) PHP is loosing session data after a regenerated session ID.

did the above changes, but now get other error:

Posted: Fri Nov 20, 2009 6:14 pm
by dirko
Warning: session_start() [function.session-start]: open(/administrator/sessions/sess_e3f3f431ef05b30a493d31e02048e72b, O_RDWR) failed: No such file or directory (2) in /home/trefeu/domains/tref.eu/public_html/help/inc/common.inc.php on line 327


maybe anyone can help on this lovely evening..??

dirko
hungary

Posted: Sun Nov 22, 2009 3:10 pm
by Klemen
Your PHP has problems creating sessions, contact your hosting company (or check your server settings).