Solved

Timing out sessions (Easy 100 pts)

Posted on 1998-09-02
5
166 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
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

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

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

Learn by example how to specify CSS selectors for Selenium WebDriver test automation software.
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?
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
Any person in technology especially those working for big companies should at least know about the basics of web accessibility. Believe it or not there are even laws in place that require businesses to provide such means for the disabled and aging p…

808 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