Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Timing out sessions (Easy 100 pts)

Posted on 1998-09-02
5
Medium Priority
?
175 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 300 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: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone 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

When it comes to write a Context Sensitive Help (an online help that is obtained from a specific point in state of software to provide help with that state) ,  first we need to make the file that contains all topics, which are given exclusive IDs. …
Ready to get certified? Check out some courses that help you prepare for third-party exams.
The viewer will get a basic understanding of what section 508 compliance can entail, learn about skip navigation links, alt text, transcripts, and font size controls.
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).
Suggested Courses

722 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