CodeCharge Studio
search Register Login  

Visual PHP Web Development

Visually Create Internationalized Web Applications, Web Reports, Calendars, and more.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> General/Other

 Concurrent login restriction for particular user

Print topic Send  topic

Author Message
davidwoo

Posts: 53
Posted: 01/14/2007, 7:07 PM

Hi all,

How to implement this in CCS? No two user (same user id) is allowed to login at the same time.

Thanks.
View profile  Send private message
peterr


Posts: 5971
Posted: 01/15/2007, 1:10 AM

This may not be a good idea because, for example, if a user logs in and then closes his Web browser he may not be able to login again and will be locked out of the system for some time.
I'm also not sure if you planned out the whole process. For example if someone logs in and goes to lunch, are they still logged-in? Or if they login and look at a page for 10 minutes, are they still logged-in? Or if they login and then close their Web browser, are they still logged-in? In all those cases you and your Web server cannot know anything about what somebody is doing on their computer, and therefore an only indication of someone being logged-in/out maybe the time that they last viewed any Web page.
Here is just one sample implementation based on above assumption:
1. Add "last_activity_date" field to your users table, then add into your Common script (.asp or .php, etc.) some tracking function that updates that field every time when users access each page.
2. Modify the SELECT statement in the CCLoginUser in your Common script to select users only when "last_activity_date" is more than 10 minutes ago or it IS NULL.
3. Also change the "last_activity_date" to NULL when someone logs out, for example in the Logout action on the Login page.
_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com
View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Internet Database

Visually create Web enabled database applications in minutes.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.