Gossamer Forum
Home : Products : DBMan : Installation :

Help with this interpretation please

Quote Reply
Help with this interpretation please
I have been getting the error "Invalid/Expired user session" after logging in and picking an action from the Main Menu. For some reason DBMAN is deleting the user's authentication key file immediately after the user picks something from the Main Menu.As per Alex's suggestion I have commented out line 77 from DBMAN, which disables the cleanup of the auth directory. The only thing I can figure is that the routine in the auth.pl is misreading the current time somehow. I am not a Perl expert. My question is can someone explain what the "9" is signifying in this line from the auth.pl:

if ((stat("$auth_dir/$file"))[9] + $auth_time < time) {

Thanks
Quote Reply
Re: Help with this interpretation please In reply to
This is the third or so person whose had this happen in the past two months or so. Strange since the authorization routine is the same as 1.x and has been in there for a year and a bit.

The 9 is the last modified time of the file. Can you try replacing it with:

if (-M "$auth_dir/$file" > 0.25) {
# delete the file
}

and see if that works?

Cheers,

Alex
Quote Reply
Re: Help with this interpretation please In reply to
the same problem......

I've tried both solutions and both worked Smile
Now I wonder what did I do exaqctly?

I mean what function gets omited by commenting line 77

and did Alex mean to change the whole expression like put

if (-M "$auth_dir/$file" > 0.25) {
# delete the file
}

instead of
if ((stat("$auth_dir/$file"))[9] + $auth_time < time) {
unlink ("$auth_dir/$file"); # Delete the file if it is too old.
}

or just instead of
if ((stat("$auth_dir/$file"))[9] + $auth_time < time) {

leaving
unlink ("$auth_dir/$file");


and wat gets omited in this case

------------------
http://ariadna.hypermart.net
Quote Reply
Re: Help with this interpretation please In reply to
Commenting it out is not a good solution. You'd be better off figuring out why the date is not calculated properly.

You should replace:

Code:
if ((stat("$auth_dir/$file"))[9] + $auth_time < time) {
unlink ("$auth_dir/$file"); # Delete the file if it is too old.
}

with:

Code:
if (-M "$auth_dir/$file" > 0.25) {
unlink ("$auth_dir/$file"); # Delete the file if it is too old.
}

Hope that helps,

Alex