473,396 Members | 1,864 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,396 software developers and data experts.

Session timeout message

Frinavale
9,735 Expert Mod 8TB
I'm toying with the idea of displaying a message a few minutes before the user's session is about to expire.

Every time the user makes a request to the server with their browser the session time is reset.

The user can be active on the site in multiple tabs in the browser.

This means that I can't tell if the user's time is about to expire client-side because the user may have made a request to the server in some other tab which would reset the Session timeout time.

I know this is probably not the best thing to ask but here I go anyway...is there a way to develop a (*wince*) global JavaScript method for all tabs?

I'm looking into using cookies since they are global...but I'm still curious about global JavaScript methods

-Frinny
Apr 28 '10 #1
8 3698
Dormilich
8,658 Expert Mod 8TB
I’m not aware global objects can access multiple windows/tabs, maybe except the new Storage objects. (and something like Mozilla’s XUL).

you could try to set a variable so that it contains a timestamp some minutes just before the session gets invalid and make an AJAX call to the server to check the timeout value, whether the session ends in some minutes (display message) or has been extended (set new request timeout).
Apr 29 '10 #2
Frinavale
9,735 Expert Mod 8TB
See that's the tricky thing Dorm....
If I make an Ajax call to the server the Session will be reset.

That's why I'm thinking cookies are the best way to go for this solution.

Thanks for the info :)
Apr 29 '10 #3
Dormilich
8,658 Expert Mod 8TB
If I make an Ajax call to the server the Session will be reset.
so you reset the session not by a script, but by request? I thought you could just bypass the reset by calling an appropriate script.
Apr 29 '10 #4
Frinavale
9,735 Expert Mod 8TB
Session is reset by request :)
I am not aware of a way to bypass this...at all.
I don't think it's possible in an ASP.NET web application.
Apr 29 '10 #5
Dormilich
8,658 Expert Mod 8TB
is that independend of the domain (e.g. www.example.com vs. nosession.example.com)?
Apr 29 '10 #6
Frinavale
9,735 Expert Mod 8TB
I'm not sure what you're getting at...
Session dependent on the domain.
Apr 29 '10 #7
Dormilich
8,658 Expert Mod 8TB
darn, I was forgetting the SOP.

sometimes it’s a difference (to the server) if you call http://www.example.com/script1 or http://subdomain.example.com/script2.
Apr 29 '10 #8
Frinavale
9,735 Expert Mod 8TB
:) I see what you're getting at now but this is a web application....any request to it uses the same session. If I requested a different web application under the same domain *I think* it would use a different Session. But I still wouldn't be able to check the session in the first web application....
Apr 29 '10 #9

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

Similar topics

12
by: Geigho | last post by:
Setting session timeout in web.config file does not seem to have any effect. Any explanation or suggestion will be appreciated.
2
by: Greg Decos | last post by:
I am using forms authentication using a FormsAuthenticationTickets set to expire in 30 minutes and the ticket is added to the collection of cookies. I am not sure where the following values are...
4
by: DavidS | last post by:
First: There are several ways to confuse one regarding session timeout. (1) web.config - <sessionState timeout="20"> (2) IIS Manager | Internet Information Services | ServerNode | Default Web Site...
11
by: Vishal | last post by:
Hello, can anybody tell me how I can extend the session expiry time? Is it done via code or via IIS? Sorry I am new and dont know about this.
5
by: Just D. | last post by:
Do we have any access to the Session object from a different Session? The idea is to save Session of a current user and then if he logs in again then return the Session back. It's not a problem to...
17
by: jensen bredal | last post by:
Hello, i'm struggling with a somehow badly understood session scenario. I provide acces to my pages based on form authentication using Session cookies. Som of my pages are supposed to be...
4
by: UJ | last post by:
I have a page where the user can upload a video file. As you can guess, this may take a while. Is there a way I can change the session timeout for just this one page? I would also want to change...
25
by: =?Utf-8?B?RGF2aWQgVGhpZWxlbg==?= | last post by:
I tried: <sessionState timeout="1"> </sessionState> bounced IIS, and after 1 minute still had a session. ??? -- thanks - dave
3
by: Mufasa | last post by:
Folks, I'm having problems with my session timeout. People using my website leave it just sitting there while they do other things. They have logged in ( using Forms Authentication ) and will be...
6
by: ChrisAtWokingham | last post by:
I have been struggling with unexpected error messages on an ASP.NET system, using SQL and C#. The application draws organisation charts, based on data stored in the SQL database. Some of the chart...
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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
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,...

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.