473,407 Members | 2,598 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,407 software developers and data experts.

Session Timeouts

My site (www.txfannin.org) has a back-end Admin area used by volunteers to add content to the Db which contains over 60 table. When each volunteer logs into the Admin area I store their Username and access lever in the $_SESSION associative array. This information is used in a log record when a record is updated.

At the beginning of each Admin module I test for the existence of a Session and if not started, then one is started. On the most used module I also set the timeout_duration = 21600 (6 hours).

The problem is that the volunteers will oftentimes work a couple of hours and then do some research, have lunch, take a nap, go to bed while the browser is still open and the admin page is still active. Thus, when they return to the computer, they again start working with the Admin module and when a record is updated the Username is Unknown. Unknown because the Session has expired and thus, the Session variable is not set and the Username is set to Unknown.

So the question is... Is there anyway to solve the problem using Sessions or do I need to just store the info in Local Storage?

TIA for any assistance.
jdadwilson
Dec 1 '19 #1
1 1888
gits
5,390 Expert Mod 4TB
well - there are different ways to solve such like for example storing an accesstoken at the client (in a javascript variable on the page, in a cookie or in local storage as you wish) and always submit it with any request - when a session expired you could then do a auto-relogin or just a session recreation in the background or such. Another way would be to let the client send a periodic request - that way you would know the website is still open in the browser and the user might be afk and wants to come back probably.

The method you want to use might even depend on the 'importance' of the usecase - since a login basically is only done if you want to secure something - which means that the 'intelligence' (usually this dictates even the effort to put in) of the logic should be on par with the requirements.
Dec 2 '19 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: Dave | last post by:
What are some of the draw backs about setting a very long session time out? What is 'too long' ?
1
by: David P. Donahue | last post by:
What is the best way (or what ways have been successful for you) to notify a user on a website that their session has timed out? I've seen various sites around the internet (my bank, for example)...
1
by: Poppy | last post by:
Is it possible for me to increase the time before a session times out and do it in the global or webconfig files ? In asp I used to put session.timeout = whatever in the session start event of...
0
by: Jason | last post by:
What is the best way to set these timeouts? Should both be the same and what will happen if they are different? Thanks Jason
6
by: Simon Harvey | last post by:
Hi everyone, If anyone can help me with the following I would be very greatful. In order to determine when a session has timed out I have some code in each page that does something like: ...
0
by: Ed Chiu | last post by:
Hi, I have an ASP.Net application, actually it's a modification of ASP.Net Portal starter kit. I am trying to change session timeout to go beyond 20 minutes. I have the following in the...
2
by: Fraijo | last post by:
how can i disable session timeouts without affecting any program codings?
3
by: M O J O | last post by:
(using asp.net 2.0) Hi, I have 5-6 large customers each using the same pages, but with their own themes. To enter my site, they all have their own urls like ... ...
4
by: Mark Rae | last post by:
Hi, I have a site which uses dynamic MasterPages. The selection of the MasterPage to use is determined by an encrypted QueryString. Session_Start looks for the presence of the QueryString,...
0
by: davidanoble | last post by:
We are converting our classic ASP application to ASP.Net, albeit slowly and have come across a problem. A user navigates through the existing application (classic ASP). Then navigates to the new...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.