PDA

Click to See Complete Forum and Search --> : Auto log-in and Cookies


val04
Apr 4th, 2001, 11:50 PM
What code should I use so that a registered user can automatically log-in without typing his username and password again?

ines
Apr 9th, 2001, 12:55 PM
you can write a cookie first time he logs in. Next time you first check the cookie, if it's not there you send him to the login page, if not he's logged in automatically.

You might want to ask the user if he wants to log in automatically at his next visit, cause in case that person is sharing his computer, he might prefer to log in at every visit.

hope this helped!
if you want more details let me know, I could send you some code.

gr8tango
Jan 17th, 2002, 07:22 PM
I'm using a vb app to login, get a cookie from the server, then send more data to the server (form data and files). The site requires login, but I don't want to continually send my user and password. Instead, if I send a cookie for the session, I can remain valid in the server's session table.

I get the cookie using:

Private Sub web1_DocumentComplete(ByVal pDisp As Object, URL As Variant)
If (pDisp Is web1.Object) Then
Debug.Print "Web document is finished downloading"
txtCK.Text = web1.Document.cookie
Dim cook, st1 As String
Dim cklngth, ck2 As Integer
cook = txtCK.Text
End If

Which displays the cookie in the text box txtCK. I can use the cookie to send more form data, but when I try to send multi-part form data (form data and a file) I cannot get past the login screen. I think I need help on building the POST string and the exact location and syntax of the cookie info.