Gossamer Forum
Home : Products : DBMan : Installation :

logins expire immediately

Quote Reply
logins expire immediately
As the subject says.(I'd posted about this a while back, but at the time it wasn't accessible to the outside world. Now, well, it is. Smile

When I login with any valid ID, it creates the auth/id.timestamp file as it should. But the next time the script runs, all those authorizations seem to disappear - doing anything invalidates all logins and returns the `invalid session' error.

On the upshot, `default' logins work perfectly. Smile

Anyway, right now it's at http://bureau42.hypermart.net/ and all the configs/Perl files/etc. are under the default names (except html.pl, which is called default.pl so I can keep things straight in my brain). Nothing important is stored there (yet) so feel free to hammer on it a little. Use admin/test to (try to) login.
Quote Reply
Re: logins expire immediately In reply to
Okay, I fibbed. Hypermart will *try* to execute just about anything... Anyway, a readable copy of html.pl is up as `default-pl.txt'.

I still have a gut feeling that the problem is somewhere there, since that's where I made the bulk of my changes. In particular, I added `use File::stat' which might confuse something somewhere else, though I'm not sure why...

(And don't yell at me about calling stat() twice, I'll fix it later. Right now, I'd be happy if it worked at all.
Quote Reply
Re: logins expire immediately In reply to
Now this is a strange one. Have you made any changes to auth.pl? Can you put a copy of auth.pl.txt up on the net?

Cheers,

Alex
Quote Reply
Re: logins expire immediately In reply to
Oops, I see the problem. It is because of the use File::Stat line. By using this module you replace perl's standard stat() function with a new one. Unfortunately the script uses stat() to determine how old a timestamp file is. Since it's not getting the proper time back it thinks all the auth files are really old and erases them.

What are you trying to do with File::stat? Remove this and I'm sure it will work.

Cheers,

Alex
Quote Reply
Re: logins expire immediately In reply to
stat() seemed to be the quickest way to check for the existence of a file. I'm sneaking it inside an IMG SRC bit, in html_record. (Basically, if an image exists for a given uid, use it, otherwise use a default image instead.)

As you suspected, removing the `use File::Stat' line fixed the problem, and stat() still does what I need it to do as well. I feel so silly now for missing something so obvious. Thanks, Alex!
Quote Reply
Re: logins expire immediately In reply to
For existance testing just do:

if (-e '/path/to/some/file') {
# it exists!
}
else {
# nope!
}

Hope that helps,

Alex