Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

refresh and timeout

Status
Not open for further replies.

garry1

Programmer
Dec 6, 2002
49
US
When user logs in I display a summary page. I would like to automatically refresh the summary page after 30 mins and timeout the user(take user back to the login page) after 1hr.

Here is my code. It refreshes the page but doesn't timeout.

<META HTTP-EQUIV="refresh" CONTENT="1800;URL='summary.cfm'">
<META HTTP-EQUIV="refresh" CONTENT="3590;URL='login.cfm'">

Thanks.
 
That's because the first refresh takes over... here you go..

Code:
<cfif not isDefined("url.norefresh")>
  <META HTTP-EQUIV="refresh" CONTENT="1800;URL='summary.cfm?norefresh=1'">
<cfelse>
  <META HTTP-EQUIV="refresh" CONTENT="3590;URL='login.cfm'">
</cfif>

It needs to be one or the other, that's all.

ALFII.com
---------------------
If this post answered or helped to answer your question, please reply with such so that forum members with a similar question will know to use this advice.
 
Code:
<META HTTP-EQUIV="refresh" CONTENT="3590;URL='login.cfm'">
Well, that's not going to work because it's reset every 1800 seconds by the first META tag.

There are several ways you can do this. One thing that comes to mind is to just store the time when the page is first loaded and pass it in the url every time it's refreshed. Then, compare the time and once it's been an hour go back to the login page.

I'm on my way out the door right now, I'll try to post back later with some code.



Hope This Helps!

Ecobb
Beer Consumption Analyst

"My work is a game, a very serious game." - M.C. Escher
 
Ecobb, as you're "on the way out the door" I'll let you know that we posted and almost the same second. I posted and your post came up right after mine.

ALFII.com
---------------------
If this post answered or helped to answer your question, please reply with such so that forum members with a similar question will know to use this advice.
 
Yep, we did it again! :)



Hope This Helps!

Ecobb
Beer Consumption Analyst

"My work is a game, a very serious game." - M.C. Escher
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top