/    Sign up×
Community /Pin to ProfileBookmark

Allow only 1 user to access site at a time

Hello! I’m creating a site that will allow users to control a webcam and motor. I only want to allow one user at a time to use the controls. (So people can’t try to force the motor to do two different things at once!) Is there a way of doing this with JavaScript?
I’m using Apache as a server, and I know I can limit the number of clients, but that would be a server-wide change, and I only need to restrict access to 1 site on the server.
I thought about using cookies, and having them expire after a certain time, but couldn’t quite get a handle on how to restrict access to just 1.

Thanks in advance!!
Megan

to post a comment
JavaScript

2 Comments(s)

Copy linkTweet thisAlerts:
@felgallSep 10.2005 — You will need to use a file or database on the server to keep track of who currently has control.
Copy linkTweet thisAlerts:
@MeganBethauthorSep 12.2005 — ::sigh:: sometimes I deserve to be kicked in the head.

For anyone else who needs to know how to do this: I was hung up on not letting anyone SEE the website if they weren't supposed to be in control. Instead, I should be focusing on only letting one person click the appropriate buttons to CONTROL the motor and camera. So in the scripts for these, I'll just put an if statement, and either do something or do nothing depending on who is trying to click there. A simple text file can keep track of who is in control and who is in line, as it will be a fairly low-traffic site.

Thanks for the help --

Megan
×

Success!

Help @MeganBeth spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.19,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...