/    Sign up×
Community /Pin to ProfileBookmark

web sessioning/security

Does anyone know a technique for forcing a web user to re-login after a given idle time? We have a massive web database program and need pretty tight user security.

to post a comment
JavaScript

2 Comments(s)

Copy linkTweet thisAlerts:
@JiggyJayJan 16.2005 — To my knowledge there is no "secure" way to do this with javascript native. Session handling is usually handled by the web server software such as ASP/PHP with the use of cookies or some form of id given to the browser. The problem with trying to handle idle time with Javascript is that it runs on the client in the browser and can be changed by the user. The user can nullify your settimeout call or Interval or modify the expiration timing. I would highly suggest using the ASP/PHP or whatever server side scripting mechanism to handle sessions.
Copy linkTweet thisAlerts:
@senshiJan 16.2005 — You could always use session cookies.

Your script checks that a cookie is present, if not, login and make a new one, if they wont allow session cookies then dont allow them on your system, I have no issues on using session cookies despite that the fact remains that cookies are abused by the advertizing industry and spyware vendors also do likewise and abuse cookies. So its understandable if people dont like them enabled but that will by far be the minority andusing them in general should not represent any problems.

So to recap, if no cookie then login, if they expire the cookie then a periodic check to see if a cookie is present per page turn will check to see if the cookie expired or expired by other means, etc...

Seems fairly logical way to do it, if you have that many users then you need to off load that side of things to the users browser.
×

Success!

Help @lcgray 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.25,
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,
)...