|
Posted by forje on 09/24/06 22:15
Gordon Burditt a écrit :
>>>> How to make a session "exclusive"? When one attempts to open a new
>>>> session either he's warned and asked to wait or any other openned
>>>> session is closed.
>>> If a session is already open, PHP generally just uses that session
>>> and does not try to open another one.
>> It is a particular application: a remote interface to administrate a
>> system. The idea is to prevent concurrent access to the system. Stop on
>> one side, start on an other...
>>
>>>> The need is to force only one user at the same time.
>>> Since there are plenty of ways to leave a session without informing
>>> PHP of that, this is going to be a severe problem. You can time
>>> out sessions but that can be very annoying to your users. Indefinite
>>> lockouts are even worse.
>>>
>> In this case, a direct close of any other openned session would not be a
>> problem.
>
> Don't be too sure. You never have browser crashes, modems dropping
> carrier, power outages, or net outages, none of which close an open
> session? You never get distracted and have to navigate elsewhere?
If a session is still open because another user leaved without closing,
a new connection would close it anyway or at least prompt the new user
for 'kill current admin session y/n?'
To do that, I need to check a flag in the database for any action in the
current session (to see if a new connection is active and close brutally
the current session if needed. I would like to avoid this check in db.
Navigation:
[Reply to this message]
|