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

Redirect unless javascript events?

Dear all,

I would like to implement a session timeout feature so that browsers are
automatically logged out if there is no activity after a certain time.

I know that this can be done with javascript or the meta tag. But I have
a "sovereign" application written using AJAX which does not require a
page refresh, but should continue to behave as though it had been refreshed.

Is there any code which can detect javascript events and reset any
timeout timer?

TIA
Aug 30 '06 #1
6 1979
turnitup wrote on 30 aug 2006 in comp.lang.javascript:
Dear all,

I would like to implement a session timeout feature so that browsers
are automatically logged out if there is no activity after a certain
time.
What is "logged out browsers"??

Is being logged in not a serverside session thing?
I know that this can be done with javascript
With serverside javascript certainly!
or the meta tag.
Log out?
But I
have a "sovereign" application written using AJAX which does not
require a page refresh, but should continue to behave as though it had
been refreshed.
Show us code, if you wish to discuss it.
Is there any code which can detect javascript events and reset any
timeout timer?
Has this to do with the text above?
--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Aug 30 '06 #2
Evertjan. wrote:
turnitup wrote on 30 aug 2006 in comp.lang.javascript:
>Dear all,

I would like to implement a session timeout feature so that browsers
are automatically logged out if there is no activity after a certain
time.

What is "logged out browsers"??
What I mean is redirected to a logout page. I should have been clearer.
>
Is being logged in not a serverside session thing?
Yes, by being redirected to a logout page!
>I know that this can be done with javascript

With serverside javascript certainly!
>or the meta tag.

Log out?
I meant redirected to logout page.
>
>But I
have a "sovereign" application written using AJAX which does not
require a page refresh, but should continue to behave as though it had
been refreshed.

Show us code, if you wish to discuss it.
There are lots of events which talk via an Ajax library to the server.
>
>Is there any code which can detect javascript events and reset any
timeout timer?

Has this to do with the text above?
>
Aug 30 '06 #3
turnitup wrote on 30 aug 2006 in comp.lang.javascript:
>What is "logged out browsers"??

What I mean is redirected to a logout page. I should have been
clearer.
>>
Is being logged in not a serverside session thing?
Yes, by being redirected to a logout page!
Why would you want to do that?
Surely if the user is not using the window for an extended time,
he/she probably will not see the logout page?

It should be much simpler to serverside transfer to the login page,
If the session has timed out serverside and the user tries to do an
action from the last page he was on?

What is the functionality of a "logout page"?
Saying "You are logged out"?
>>But I
have a "sovereign" application written using AJAX which does not
require a page refresh, but should continue to behave as though it
had been refreshed.

Show us code, if you wish to discuss it.

There are lots of events which talk via an Ajax library to the server.
Yes, however you were talking about your application.

So you want, I presume, have Ajax ask the server at certain intervals if
the session still exists, and if not, change the page to a page saying
"You are logged out" without redirecting to it?

That seems not that difficult.
Is it useful?
--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Aug 30 '06 #4
Evertjan. wrote:
So you want, I presume, have Ajax ask the server at certain intervals if
the session still exists, and if not, change the page to a page saying
"You are logged out" without redirecting to it?

That seems not that difficult.
Is it useful?

OK, let me explain!

Basically, if a user leaves their terminal unattended, I want to
redirect the page to a page which they will log them out.

I can do this using javascript, and an onload timer. But I want this
timer to be reset on any javascript event.
Aug 30 '06 #5
turnitup wrote on 30 aug 2006 in comp.lang.javascript:
Evertjan. wrote:
>So you want, I presume, have Ajax ask the server at certain intervals if
the session still exists, and if not, change the page to a page saying
"You are logged out" without redirecting to it?

That seems not that difficult.
Is it useful?

OK, let me explain!

Basically, if a user leaves their terminal unattended, I want to
redirect the page to a page which they will log them out.
"a page which they will log them out"

Who will log whom out?
I can do this using javascript, and an onload timer. But I want this
timer to be reset on any javascript event.
onload = "var myTimer = window.setTimeout(...,..)"

function resetMyTimer(){
window.clearTimeout(myTimer)
myTimer = window.setTimeout(...,..)
}

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Aug 30 '06 #6

turnitup wrote:
Dear all,

I would like to implement a session timeout feature so that browsers are
automatically logged out if there is no activity after a certain time.

I know that this can be done with javascript or the meta tag. But I have
a "sovereign" application written using AJAX which does not require a
page refresh, but should continue to behave as though it had been refreshed.

Is there any code which can detect javascript events and reset any
timeout timer?
That is normally done server side and is based on interaction with the
server, not events on the client. If a user doesn't interact with the
server for a time, their session times out and whatever they do after
that will be re-directed to a "your session timed out" page.

On the client, you can't tell whether the user is still interacting
with the page or not. Even if you trap say onclick, onkeypress and
onscroll at the document level, how do you know that users aren't using
some client-side technology to make those events occur, rather than
actually interacting with the page?
--
Rob

Aug 30 '06 #7

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

Similar topics

7
by: Donna Hawkins | last post by:
I want to use javascript to redirect to a URL which has been passed as a variable (in php). I have searched but cannot find any solution. I think this code is a basic redirect: <script...
5
by: Nazir | last post by:
I am trying to do something pretty simple - but can't see how it can be done in ASP.NET. I have an aspx web page with a form which opens up a new window. The web page uses code behind to build...
1
by: thomson | last post by:
Hi all, In Javascript we have the option of not showing the title bar, address bar through the window.open function, Is there any option in Server.transfer or Response.redirect to hide the...
5
by: RayAll | last post by:
I have used a response.redirect() in the first page of my weblog to transfer it to anther page,but it seemes to be slow.Is there a workaround (probably Server.Transfer???)??? Thanks
5
by: Dave | last post by:
Hi All, Can anyone suggest a reliable solution to php redirect?: header("Location: $redir_url"); if the above times out in $timeout seconds header("Location: $alt_redir_url"); Many thanks,
3
by: KL | last post by:
I am trying to get a form to work with validating a checkbox. It validates the checkbox ok, but it always redirects, even if the box isn't checked...it does alert, but I was hoping that it would...
7
by: =?Utf-8?B?YWxiZXJ0b3Nvcmlh?= | last post by:
Hi everybody, I'm using a system.timers.timer object like this: Dim aTimer As New System.Timers.Timer() In my page_load event I use this: aTimer.Interval = 5000 aTimer.Enabled = True...
5
by: Sin Jeong-hun | last post by:
class Manager { public event ItemEventHandler ItHappened; public Manager { Item i; i.ItHappend+=new ItemEventHandler(OnItHappened); } void OnItHappened(...) {
9
by: RN1 | last post by:
When a server encounters the line Response.Redirect("abcd.asp") in a ASP script, the server tells the browser that it has to be redirected to another page (which is abcd.asp, in this case)....
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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...

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.