[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

[MacPerl] Implementing a logon status procedure.



I am writing a Perl cgi script that allows a user to log on and log off a
web site. The script get the user's logon or logoff times and status (ON or
OFF) then write them respectively to a log and a status file.

The script needs to verify if the user is not already logged on (or if the
user tries to logon with the same userid/password as an already logged on
user) before giving him/her access. So at logon time the script reads the
user current status from the status file (Currently ON or OFF) and toggle
the status according to the content of that file. If the status file
reveals that the user is currently logged on access will be denied.

The problem is that if the user's machine/browser crashes before he/she has
the time to logoff, the status file does not get updated and the user
status still contains the Currently ON flag even though the user is not
logged on anymore. Consequently next time the user tries to log on access
will be denied.

Can anyone suggest a way to avoid such a problem?

This script is developped using MacPerl. Still, pardon me if my question is
too general for the list.

Stephane.


               ____S__t__e__p__h__a__n__e______J__o__s__e____

                     mailto:stephane.jose@sympatico.ca


                 Don't you ever try to look behind my eyes
                 You might not like what they have seen...

                 Ron L. Hoover - Joe's Garage

***** Want to unsubscribe from this list?
***** Send mail with body "unsubscribe" to mac-perl-request@iis.ee.ethz.ch