473,748 Members | 2,294 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to extend a Session

6 New Member
I have C#.net web application which is using sessions.
When a session is going to end is it possible to show a message that the session is going to end and that do you want to continue. If the continue button is clicked the session should continue else the session can expire.
How can i do it.
Mar 30 '08 #1
1 1131
balabaster
797 Recognized Expert Contributor
I have C#.net web application which is using sessions.
When a session is going to end is it possible to show a message that the session is going to end and that do you want to continue. If the continue button is clicked the session should continue else the session can expire.
How can i do it.
Hmm, tricky one. Okay...as the page is being built check the Session.Timeout to find out how long the session lasts if no interaction is made.

Build a javascript that runs a timer for a period shorter than the session timeout and starts when the page loads... when the timer elapses, fire a confirm box. If the OK button is clicked then use window.location = http://blahblah.com to reload the page and therefore resetting the session timer back to 0.

It really is a hack to do what you want - in an ideal world when the session is about to timeout at the server end, it would notify the client - but that's not really achievable in the disconnected world of the web.
Mar 30 '08 #2

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

Similar topics

2
7681
by: sdhyok | last post by:
I think the two script should produce the same results, but not. Why? ---------------- Script #1 ls = ls.extend() print ls -> --------------- Script #2
10
2030
by: Jerzy Karczmarczuk | last post by:
Gurus, before I am tempted to signal this as a bug, perhaps you might convince me that it should be so. If I type l=range(4) l.extend() l gives , what else... On the other hand, try
2
1781
by: Boobie | last post by:
I switched to using this function to create element: ---------------------------------------------------- function elem(name, attrs, style, text) { var e = document.createElement(name); if (attrs) { for (key in attrs) { if (key == 'class') { e.className = attrs; } else if (key == 'id') { e.id = attrs;
4
3890
by: Yuriy | last post by:
Hi, everybody! I need every 20 min extent my Session timeout. Any suggetions appreciated! Thanks
2
1449
by: Yuriy | last post by:
Hello ! I have a problem with session variables and i need to do something with my session I need every 20 min extend my Session timeout. Any suggetions appreciated! Thanks
4
3853
by: rick | last post by:
hi Is there a DB2 equivalent of Informix.Extend function? or please help me the best way to create one Thanks rick
3
3584
by: jacobstr | last post by:
I've noticed Object.extend used in a few different ways and I'm having trouble distinguishing why certain usages apply to a given situation. On line 804 Ajax.Base is defined as follows: Ajax.Base = function() {}; Ajax.Base.prototype = { setOptions: function(options) { <...>
5
2539
by: thefox149 | last post by:
Hi All I know I can set the php.ini timeout to increase to what ever I like I also know I can do it from a php script. My question is if I can change it from the script will it extend the seesion for all users or only the user who intiated the call from the script? If not how can I set intranet users to have a time out of 1hr and internet users 15mins any help would be greatly appreciated
7
20943
by: anithaapr05 | last post by:
Hi, I am creating a session when user successfully login to the site and user gets a form to input some data into database. Assume that user entered data into some fileds and let the browser ideal and doing some other work in his/her system. My requrement is, 2 mins before(after 13 mins) of session timeout(I set session timeout as 15 mins in web.config), user should get an alert as" Your session is about to timeout in 2 mins(at...
0
8983
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8822
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9528
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9359
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9236
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6792
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6072
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
3298
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2774
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.