Solved

Timing out sessions (Easy 100 pts)

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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

Suggested Solutions

Read about why website design really matters in today's demanding market.
Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo‚Ķ
This video teaches users how to migrate an existing Wordpress website to a new domain.
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

810 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