I know this sounds simple to you guys, but I can't find anywhere in the internet on how to solve this.
Basically, I have a login page..
and a verify.
asp page which will set the session variable to the user username:
Code:
if rs("password") = Password then
Session("name") = Request.Form("txtUsername")
......
......
Response.Redirect("protectedpage.asp")
Here is the question:
In the protectedpage.
asp page, I want to perform an update statement reffering to the username, something like this:
Code:
If Session("name") = "" Then
Response.Redirect("login.asp")
Else
Dim cn,sql,rightnow,user,mySessionID
rightnow = date()
mySessionID = "this part i want to pull the session value but I dont know the format?"
Set cn = Server.CreateObject("ADODB.Connection")
cn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source="& Server.MapPath("db/users.mdb")
Set sql = cn.Execute("UPDATE userlist SET LastActive = " & rightnow & " WHERE username = "this part??" ")
End If