Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Conexion usuario
- Dim data As DataSet = CType(Application("datos"), DataSet)
- For Each inst As DataRow In data.Tables("Customers").Rows
- If Login1.UserName = inst.Item("ContactName") AndAlso Login1.Password = inst.Item("ContactName") Then
- Dim cookie As HttpCookie = Request.Cookies(Login1.UserName)
- ' Si no existe la cookie de ultima sesión, la crea en el momento
- ' Se guarda "ultimaconexion" en una session, ya que sino se sobreescribe el valor de la cookie, mostranso siempre la fecha d ela conexión actual
- If cookie Is Nothing Then
- cookie = New HttpCookie(Login1.UserName)
- End If
- Session("Ultimaconexion") = cookie("Ultimaconexion")
- cookie("Ultimaconexion") = Now
- cookie.Expires = Now.AddMonths(1)
- Response.Cookies.Add(cookie)
- ' Guardar el usuario actual en la sesión
- Session("user") = Login1.UserName
- ' Indicamos que ha conectado correctamente
- e.Authenticated = True
- End If
- Next
- Pagina maestra
- If Session("Ultimaconexion") Is Nothing Then
- LblNombre.Text = Now
- Else
- LblVisita.Text = Session("Ultimaconexion")
- End If
- LblNombre.Text = Session("Ultimaconexion")
- LblVisita.Text = Session("user")
Add Comment
Please, Sign In to add comment