I have an application that, after 20 mins of idle (detected
by JS), the user is given a warning saying they are about to
be logged out with a link to keep the session going. My
original plan was to sent an AJAX request to a page when the
link is clicked, but I have read that an AJAX
Just off the top of my head and without doing any research into the topic.
Assuming everything you said is accurate, that you can't sustain the session
with an AJAX request, when your user clicks the link, it could load a 1px
x1px iframe into a div on the page that loads a keep alive page, thus
I have read that an AJAX request will not keep the session alive.
Where did you hear that? If the Ajax request is to a ColdFusion page
that is part of your application it will most certainly keep the session
alive. The server, after all, doesn't even know it is an Ajax call.
~Brad
Server:
If you have a session going and it is idle up to the timeout it will end. As
soon as another request happens after the timeout, a new session begins. If a
request occurs before the timeout, the countdown begins all over again.
Client/browser side:
Seems like you need to write
: Friday, August 14, 2009 3:59 PM
To: cf-talk
Subject: RE: keeping a session alive
I have read that an AJAX request will not keep the session alive.
Where did you hear that? If the Ajax request is to a ColdFusion page that
is part of your application it will most certainly keep the session alive
that it adds this to the
header
automatically.
-Original Message-
From: b...@bradwood.com [mailto:b...@bradwood.com]
Sent: Friday, August 14, 2009 3:59 PM
To: cf-talk
Subject: RE: keeping a session alive
I have read that an AJAX request will not keep the session alive
2009/8/15 Eric Hynds e...@hynds.net:
I was wondering ... if what I read was wrong and you actually can keep the
session alive with an AJAX request.
This is the case.
mxAjax / CFAjax docs and other useful articles:
http://www.bifrost.com.au/blog
Bobby,
1) I absolutely REFUSE to use a frame or Iframe whatsoever.
Then you like making life hard. ;) While an frame would be the most
compatible, and IFRAME should really work in every modern browser (doesn't
work in Netscape 4, but if you need that you could use an ILAYER tag for
NS4.)
setInterval(document.images['session'].src='image.cfm';,600);
This will keep the session alive...
-Original Message-
From: Dan G. Switzer, II [mailto:[EMAIL PROTECTED]
Sent: Friday, December 02, 2005 11:03 AM
To: CF-Talk
Subject: RE: Keeping a session alive
Bobby,
1) I absolutely REFUSE
Hey, thats pretty nifty there thanks.
..:.:.:.:.:.:.:.:.:.:.:.:.:.:.
Bobby Hartsfield
http://acoderslife.com
-Original Message-
From: Katz, Dov B (IT) [mailto:[EMAIL PROTECTED]
Sent: Friday, December 02, 2005 11:08 AM
To: CF-Talk
Subject: RE: Keeping a session alive
If you want
AM
To: CF-Talk
Subject: RE: Keeping a session alive
Bobby,
1) I absolutely REFUSE to use a frame or Iframe whatsoever.
Then you like making life hard. ;) While an frame would be the most
compatible, and IFRAME should really work in every modern browser (doesn't
work in Netscape 4, but if you
1) I absolutely REFUSE to use a frame or Iframe whatsoever.
You're right. Have a look at XMLHttpRequest in Javascript.
You can call a CF template every 10 min or so, directly from a script,
without having to reload any part of the page,
no blink, no glass cursor, no nothing. The user will see
This is probably what I meant when I said use AJAX.
-Original Message-
From: Claude Schneegans [mailto:[EMAIL PROTECTED]
Sent: Friday, December 02, 2005 11:25 AM
To: CF-Talk
Subject: Re: Keeping a session alive
1) I absolutely REFUSE to use a frame or Iframe whatsoever.
You're right
-Original Message-
From: Katz, Dov B (IT) [mailto:[EMAIL PROTECTED]
Sent: Friday, December 02, 2005 11:08 AM
To: CF-Talk
Subject: RE: Keeping a session alive
If you want to refresh, you can also use an image
I've an extensive article and sample code for using a GIF as a data
a session alive
-Original Message-
From: Katz, Dov B (IT) [mailto:[EMAIL PROTECTED]
Sent: Friday, December 02, 2005 11:08 AM
To: CF-Talk
Subject: RE: Keeping a session alive
If you want to refresh, you can also use an image
I've an extensive article and sample code for using a GIF
This is probably what I meant when I said use AJAX.
Probabily, although AJAX may be a big word when only a couple of lines
of code are needed
in this case.
~|
Logware (www.logware.us): a new and convenient web-based time
Bobby,
Just out of curiosity... can a frame trigger a js event in another frame?
Provider there are the same domain (which is usually the case,) yes. Just
use the parent object to reference the document object that created the
iframe /.
Just curious since I still refuse to use one :)
That's
Ive got a js routine that does just this.
Basically you set it to a minute less than your session timeout. If
it expires, it reloads the page they are on. Just dont want to use it
with any pages that you post to.
Let me know if you want it.
On 12/1/05, Bobby Hartsfield [EMAIL PROTECTED]
so if they are in the middle of typing War and Peace in a form field when
the JS kicks off, they lose it all?
Mike
-Original Message-
From: Ryan Guill [mailto:[EMAIL PROTECTED]
Sent: Thursday, December 01, 2005 1:22 PM
To: CF-Talk
Subject: Re: Keeping a session alive
Ive got a js
, 2005 1:22 PM
To: CF-Talk
Subject: Re: Keeping a session alive
Ive got a js routine that does just this.
Basically you set it to a minute less than your session timeout. If
it expires, it reloads the page they are on. Just dont want to use it
with any pages that you post to.
Let me know
, December 01, 2005 2:25 PM
To: CF-Talk
Subject: RE: Keeping a session alive
so if they are in the middle of typing War and Peace in a form field when
the JS kicks off, they lose it all?
Mike
-Original Message-
From: Ryan Guill [mailto:[EMAIL PROTECTED]
Sent: Thursday, December 01, 2005 1:22 PM
-
From: Ryan Guill [mailto:[EMAIL PROTECTED]
Sent: Thursday, December 01, 2005 2:22 PM
To: CF-Talk
Subject: Re: Keeping a session alive
Ive got a js routine that does just this.
Basically you set it to a minute less than your session timeout. If
it expires, it reloads the page they are on. Just
something like this too much to have it handed to me :)
..:.:.:.:.:.:.:.:.:.:.:.:.:.:.
Bobby Hartsfield
http://acoderslife.com
-Original Message-
From: Ryan Guill [mailto:[EMAIL PROTECTED]
Sent: Thursday, December 01, 2005 2:22 PM
To: CF-Talk
Subject: Re: Keeping a session alive
Ive
: Thursday, December 01, 2005 2:58 PM
To: CF-Talk
Subject: RE: Keeping a session alive
Very much appreciated. I really was just curious of what others thought
about the idea... pros/cons... that sort of thing. I'd enjoy writing
something like this too much to have it handed to me
://acoderslife.com
-Original Message-
From: Russ [mailto:[EMAIL PROTECTED]
Sent: Thursday, December 01, 2005 3:10 PM
To: CF-Talk
Subject: RE: Keeping a session alive
Why not use a frame or an iframe to load a page on the server in the
background? This way they won't have to lose the current
to
the site, and that is all that's required to keep the session active.
-Original Message-
From: Bobby Hartsfield [mailto:[EMAIL PROTECTED]
Sent: Thursday, December 01, 2005 3:16 PM
To: CF-Talk
Subject: RE: Keeping a session alive
Like I said in the original post, both are options
-Talk
Subject: RE: Keeping a session alive
Well if you use an iframe, you can set it to a page that reloads every few
seconds (minutes). No javascript needed, just META REFRESH. Same with
Frame. But Frame would require you to build your site using frames (yuck).
I would really love an AJAX
PROTECTED]
Sent: Thursday, December 01, 2005 1:56 PM
To: CF-Talk
Subject: RE: Keeping a session alive
Only if the session dies before they submit it. In that case, they are
sent to the login form and the forms post is lost.
~|
Logware
, but it sounds
like it should work, huh?
M!ke
-Original Message-
From: Bobby Hartsfield [mailto:[EMAIL PROTECTED]
Sent: Thursday, December 01, 2005 1:56 PM
To: CF-Talk
Subject: RE: Keeping a session alive
Only if the session dies before they submit it. In that case
:[EMAIL PROTECTED]
Sent: Thursday, December 01, 2005 1:56 PM
To: CF-Talk
Subject: RE: Keeping a session alive
Only if the session dies before they submit it. In that case, they are
sent to the login form and the forms post is lost
[mailto:[EMAIL PROTECTED]
Sent: Thursday, December 01, 2005 4:33 PM
To: CF-Talk
Subject: RE: Keeping a session alive
Yeah, it sounds like it would work (for the most part) but it would probably
have to be stored in a session of its own and used to populate the form
again since the form scope would
Maybe I missed something earlier in the thread, but why not just make the
session time out longer, like a Day, or 4 hours. Why go though all this
trouble when a long session timeout would accomplish the same thing??
...
Ben Nadel
Web Developer
Nylon Technology
6 West 14th
-
From: Russ [mailto:[EMAIL PROTECTED]
Sent: Thursday, December 01, 2005 4:49 PM
To: CF-Talk
Subject: RE: Keeping a session alive
Why are you thinking so complicated? A simple 1x1 pixel iframe that goes to
a refresh.cfm page should do the trick. And the page can be refreshed using
javascript
Hartsfield
http://acoderslife.com
-Original Message-
From: Ben Nadel [mailto:[EMAIL PROTECTED]
Sent: Thursday, December 01, 2005 4:56 PM
To: CF-Talk
Subject: RE: Keeping a session alive
Maybe I missed something earlier in the thread, but why not just make the
session time out longer, like
Nadel [mailto:[EMAIL PROTECTED]
Sent: Thursday, December 01, 2005 4:56 PM
To: CF-Talk
Subject: RE: Keeping a session alive
Maybe I missed something earlier in the thread, but why not just make the
session time out longer, like a Day, or 4 hours. Why go though all this
trouble when a long
Pass a WDDX packet, use hidden form fields and then a javascript form
submit. There are probably a few other ways.
-Original Message-
From: Ryan Guill [mailto:[EMAIL PROTECTED]
Sent: Thursday, December 01, 2005 3:22 PM
To: CF-Talk
Subject: Re: Keeping a session alive
How would you
: Keeping a session alive
Why are you thinking so complicated? A simple 1x1 pixel iframe that
goes to a refresh.cfm page should do the trick. And the page can be
refreshed using javascript or meta refresh without affecting the main
page that the user is working
Why not set the session timeout to be a very large value?
It seems almost pointless to have the keep-alive ping yet
still want to keep the site authenticated?
One reason you might do this is to keep a session alive as long as the
browser is actually open and pointing to that site, but kill
Not just one reason but THE reason :)
..:.:.:.:.:.:.:.:.:.:.:.:.:.:.
Bobby Hartsfield
http://acoderslife.com
-Original Message-
From: Dave Watts [mailto:[EMAIL PROTECTED]
Sent: Thursday, December 01, 2005 6:40 PM
To: CF-Talk
Subject: RE: Keeping a session alive
Why not set
39 matches
Mail list logo