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

i want to session to never die................

dmjpro
2,476 2GB
I am working on a project which uses Oracle9i App Server and Database also.
I explicitly set the session time out 30 seconds by calling the session.setMaxInactiveInterval(nseconds).
And i used a technique.....
Our session_id lives per one browsing session...
I kept a hidden frame on the main page, which automatically detects the time before 5 seconds of session time out..
And that hidden frame is reloaded automatically before 5 seconds of session time out...So the session againgst that browsing session never be died, but it happens
My code is following.................


<%@ page contentType="text/html;charset=WINDOWS-1252"%>
<html>
<head>
<title>False Request</title>
<script language = javascript>
var session_time_out = null;
var page_start_time = null;
function startPage()
{
try
{
session_time_out = document.all.session_time_out.value;
page_start_time = new Date();
var new_fun = function()
{
try
{
//alert(session_time_out + "\t" + page_start_time.getTime());
var right_now = new Date();
//alert(right_now.getTime() - (session_time_out+page_start_time.getTime()));
//alert(session_time_out);
//alert(right_now.getTime()/1000 + "\t\t" +page_start_time.getTime()/1000);
//alert(right_now.getTime() - page_start_time.getTime() + "\t\t" + (session_time_out - 5)*1000);
if(right_now.getTime() - page_start_time.getTime() >= (session_time_out - 5)*1000)
{
//alert("");
window.location.reload(); //Reloads the page just before 5 seconds of session time out
}
}
catch (err)
{
alert(err.description);
}
}
window.setInterval(new_fun,1000);
}
catch (err)
{
alert(err.description);
}
}
</script>
</head>
<body onload = startPage()>
<input type = hidden name = session_time_out value = "<%=session.getMaxInactiveInterval()%>">
</body>
</html>


Plz arrange this code for ur convenience...
Is my technique right or wrong....
I think there is any problem with App server..
Pllllllllllllllllllllzzzzzzzzzzzzzzzzzzzzzzzzzzzzz help me out...................
Jan 31 '07 #1
2 1381
Motoma
3,237 Expert 2GB
I think the folks in the Javascript forum may be able to help you out.
Jan 31 '07 #2
acoder
16,027 Expert Mod 8TB
Put your hidden input value in a form. Give it an id of the same name as its name:
[HTML]<input type=hidden name=session_time_out id=session_time_out ...[/HTML]
Also, the line after the 'try':
Expand|Select|Wrap|Line Numbers
  1. session_time_out = document.all.session_time_out.value;
change to:
Expand|Select|Wrap|Line Numbers
  1. session_time_out = document.getElementById('session_time_out').value;
so you're getting the element value from its id (the standard way) instead of using document.all (IE, etc. way).
Jan 31 '07 #3

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

Similar topics

27
by: mrbog | last post by:
Tell me if my assertion is wrong here: The only way to prevent session hijacking is to NEVER store authentication information (such as name/password) in the session. Well, to never authenticate...
2
by: Derek Fountain | last post by:
I have some code at the top of each page that says session_start() then checks for a value in the session. If the person never logged in the session is empty and they get bounced to the login page....
8
by: Karen | last post by:
Hi there.... i got a quick one for you guys. i've this session variable that is updated by calling a server method (i set this value when the user hits a submit button in my form. The server...
5
by: Ronald | last post by:
Hi there! I have a website partly written in ASP in where a shoppingbasket is used. The products of the shoppingbasket are stored in the session-object. (We use IIS6 on Windows 2003). This was...
4
by: Jack | last post by:
Hi, I was wondering if for an application, I can change the default session timeout property via IIS Administration? If so, how does one do it. Thanks in advance.
6
by: Gonenc Ercan | last post by:
Hi, I ve ended up debugging a ASP.NET project (with about 380 files on the project .NET Framework 1.0 on IIS 5.0) which has a memory leak... The memory rises too fast. With about 25-30 active...
31
by: Harry Simpson | last post by:
I've come from the old ASP camp where session variables were not used. When i started using ASP.NET in 2001, I started using them again because it was ok from what I'd read. I've been merrily...
43
by: davidkoree | last post by:
I mean not about cookie. Does it have something to do with operating system or browser plugin? I appreciate any help.
12
by: MrHelpMe | last post by:
Hello again all, I've finished my whole application and now I don't like the whole session variables that I am using. I have a form, user fills in info clicks submit and using CDOSYSMail an...
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:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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: 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
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,...

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.