Solved

Timing out sessions (Easy 100 pts)

Posted on 1998-09-02
5
158 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
Comment Utility
What do you want to happen after 5 minutes?
0
 
LVL 1

Expert Comment

by:dangel
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Author Note: Since this E-E article was originally written, years ago, formal testing has come into common use in the world of PHP.  PHPUnit (http://en.wikipedia.org/wiki/PHPUnit) and similar technologies have enjoyed wide adoption, making it possib…
Although it can be difficult to imagine, someday your child will have a career of his or her own. He or she will likely start a family, buy a home and start having their own children. So, while being a kid is still extremely important, it’s also …
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
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…

762 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now