Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Code for "Last logged in:....", thanks!!

Status
Not open for further replies.

Beat

Technical User
Aug 26, 2001
41
0
0
SE
when a user log in I want to show them the date and time of the last session they were logged in.

Does anyone have the code?

Thanks!
 
I would sugest using cookies.
'In the page that writes the cookie
<%@Language=VBScript %>
<%
Response.Cookies(&quot;LastVisited&quot;)(&quot;LastVisit&quot;) = Now
Response.Cookies(&quot;LastVisited&quot;)(&quot;Name&quot;) = &quot;Smith&quot;
%>
'In the page to read the cookie
<%@Language=VBScript %>
<%
Response.Write&quot;Last visit to the site: &quot; & _
Request.Cookies(&quot;LastVisited&quot;)(&quot;LastVisit&quot;)
Response.Write&quot;<br>
Response.Write&quot;Your name :&quot; & _
Request.Cookies(&quot;LastVisited&quot;)(&quot;Name&quot;)
%>

Or put the info into a database to prevent problems with people having coockies disabled.


Live long and make your kids suffer..
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top