473,804 Members | 4,408 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Help with session keep alive code using .asp as img src

I've got a standard form on an ASP page to collect resumes from visitors.
The page can be accessed only after the visitor has logged into the site.
The issue that I'm running into is that the users are exceeding the length
of the session timeout, so when they submit the form, it is taking them back
to the login page instead of submitting the form.

The solution I am trying (extending timeout session is not an option due to
the heavy load on this server) involves writing a Javascript timer that
triggers an automatic request for a .asp page by setting the object of an
IMG SRC tag. The JS calls the "image" X minutes before the session
expiration, and there's some basic asp code in the "keepalive. asp" page to
ensure that the asp interpreter is invoked.

I've checked the IIS logs and have confirmed that the keepalive.asp page is
being requested at the appropriate intervals, and I've also confirmed that
the session ID on those calls is the same as the initial call to the
"resumeinput.as p" page.

Unfortunately, this is not keeping the session alive. Can someone shed some
light on why this method of keeping the session alive is not working?

Here's some snippets of my code:

function refreshIt() {
if (!document.imag es) return;
document.images['myPic'].src = 'sessionkeepali ve.asp'
setTimeout('ref reshIt()',60000 ); // refresh every X minutes
}

and here's the code for the image/asp:

<img src="keepalive. asp" name="myPic" width="1" height="1">

Thanks,

Jason

Jul 19 '05 #1
1 14969

Two things to try:

1. Add a varying querystring to your clientside src request to ensure the
browser always avoids the cache.
Something like
document.images['myPic'].src = 'sessionkeepali ve.asp?xxx='+es cape(new
Date());

2. Your asp page should return an image, not an img html tag. Either
redirect to an image file or binarywrite an image file back to the response.

Tim


"Jason" <ja********@spa m-none-yahoo.com> wrote in message
news:vf******** ****@corp.super news.com...
I've got a standard form on an ASP page to collect resumes from visitors.
The page can be accessed only after the visitor has logged into the site.
The issue that I'm running into is that the users are exceeding the length
of the session timeout, so when they submit the form, it is taking them back to the login page instead of submitting the form.

The solution I am trying (extending timeout session is not an option due to the heavy load on this server) involves writing a Javascript timer that
triggers an automatic request for a .asp page by setting the object of an
IMG SRC tag. The JS calls the "image" X minutes before the session
expiration, and there's some basic asp code in the "keepalive. asp" page to
ensure that the asp interpreter is invoked.

I've checked the IIS logs and have confirmed that the keepalive.asp page is being requested at the appropriate intervals, and I've also confirmed that
the session ID on those calls is the same as the initial call to the
"resumeinput.as p" page.

Unfortunately, this is not keeping the session alive. Can someone shed some light on why this method of keeping the session alive is not working?

Here's some snippets of my code:

function refreshIt() {
if (!document.imag es) return;
document.images['myPic'].src = 'sessionkeepali ve.asp'
setTimeout('ref reshIt()',60000 ); // refresh every X minutes
}

and here's the code for the image/asp:

<img src="keepalive. asp" name="myPic" width="1" height="1">

Thanks,

Jason

Jul 19 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

15
3133
by: Thomas Scheiderich | last post by:
I am trying to understand Session variables and ran into a question on how they work with data that is passed. I have an HTM file that calls an ASP file and sends the name either by GET or POST. When I find is that if I send the value by the GET method, response.write("From QueryString: " & Request.QueryString("usernamefromform") & "<br><br>")
7
2889
by: someone | last post by:
Let's say I have a Session timeout of 20 minutes. If the browser periodically request a graphic file, will that keep its Session alive? What keeps the Session alive? Is it the Session cookie that is sent in the HTTP header from the browser? If that is so, will requesting a graphic file send the cookie? Thanks.
15
10996
by: dee | last post by:
Hi, What is the maximum number of minutes for Session timeout that I can specify in web.config? Thanks. Dee
4
4125
by: pgmanno | last post by:
Hello all, Here is my question. I have an AxWebBrowser (hereafter refered to as "Browser") control framed in a smart client. The smart client requires logon, and the web app that the Browser is pointing to requires logon and is using Forms Authentication. I have set up a web service so that when the user logs on to the smart client, s/he can also log on to the website (basically, the username/password is passed up, auth ticket set...
11
26647
by: cybervigilante | last post by:
I can't seem to change the include path on my local winmachine no matter what I do. It comes up as includ_path .;C:\php5\pear in phpinfo() but there is no such file. I installed the WAMP package and PEAR is in c:\wamp\php\pear I modified php.ini in the c:\wamp\php directory to reflect the actual path, but even stopping and restarting my server shows the c: \php5\pear path. I can't change it no matter what I do I also tried the...
6
5682
by: laredotornado | last post by:
Hi, When a user logs into our site, we create a session variable to denote the session is active and another to denote who is logged in. Once the user closes the browser and re-opens it, the session is destroyed and the variables are gone. How can I keep the session alive for 24 hours even if the user closes and re-opens the browser?
0
1511
by: Ramchandar | last post by:
In my aspx page i want the lot of informations to be filled by the user. But wen the user takes some break to fill the form n resumes after some time the page gets expired. So to keep the session alive i used the following javascript code but it didnt work. function KeepMeAlive() { var myImg; myImg =document.getElementById('keepAliveIMG'); if (myImg) myImg.src =...
9
1827
by: gnewsgroup | last post by:
I am using forms authentication for my web application. In web.config, I have this: <authentication mode="Forms"> <forms loginUrl="Login.aspx" protection="All" timeout="120" name=".ASPXAUTH" path="/"
3
5007
by: dihola | last post by:
Hi, I have a website running in IIS7 and it seems to be creating a new session for every request I make. The values I store in Session are lost with every request. This is the forms bit in my web.config: <authentication mode="Forms"> <forms name=".ReMaCRM" loginUrl="~/Login.aspx" defaultUrl="~/Default.aspx" cookieless="AutoDetect" domain="" timeout="10" protection="All" /> </authentication>
0
9579
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
10577
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
10077
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
7620
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
6853
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();...
0
5521
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5651
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4299
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
3
2991
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.