Solved

Timing out sessions (Easy 100 pts)

Posted on 1998-09-02
5
168 Views
Last Modified: 2013-12-25
I want my page to beable to time a user out after being logged in for 5 minutes of inactivity.  Whats the best way of doing this?  I've tried cookies, but they save the dates as strings, and I can't get the VB Script to treat the strings as dates.

Keith
kjsmith3@jps.net
0
Comment
Question by:kjsmith3
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 
LVL 84

Expert Comment

by:ozo
ID: 1854737
What do you want to happen after 5 minutes?
0
 
LVL 1

Expert Comment

by:dangel
ID: 1854738
You can convert the string value to date.  For example, your string variable is strWhenever:
Whenever = CDate(Whenever)
Make sure that you use the IsDate function to determin if Whenever can be converted to a date or time.
Other conversions you can play with are: CStr(convert to string), CDbl(convert to double), CCur(convert to currency), CBye(convert to byte), CBool(convert to boolean), CInt( convet to integer), and some others.
0
 

Author Comment

by:kjsmith3
ID: 1854739
I'm tring to use addDate to adjust the date by five minutes, when I try this code snip
<%
time1 = now
time2 = DataAdd("n",10,cdate(time1))
%>
 I get the following error

Microsoft VBScript runtime error '800a000d'

Type mismatch: '[undefined]'

/cmnhome/TimerTest.asp, line 3
Hope this helps.
0
 

Author Comment

by:kjsmith3
ID: 1854740
If the user is inactive for more than five minutes, when the user tries to click a link to a new page, I want to instead send them to a timed out page.


0
 
LVL 10

Accepted Solution

by:
MasseyM earned 100 total points
ID: 1854741
You had an "A" where an "E" needed to be...

Use This:

<%
time1 = now
time2 = DateAdd("n",5,cdate(time1))
%>

<%
Response.Write Time1 & "<BR>"
Response.Write Time2
%>


Works perfect for me...

0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
When crafting your “Why Us” page, there are a plethora of pitfalls to avoid. Follow these five tips, and you’ll be well on your way to creating an effective page.
This tutorial demonstrates how to identify and create boundary or building outlines in Google Maps. In this example, I outline the boundaries of an enclosed skatepark within a community park.  Login to your Google Account, then  Google for "Google M…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

751 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question