Cookies+by+Javascript

The following code simulates a login screen. If the check box labeled "Remember me" is checked, upon login a cookie containing the login information is saved onto the user's computer. When he or she revisits the site, the login fields will be filled in automatically. code format="vbnet" ' Cookies by Javascript ' By Brent D. Thorn, 2/2008 ' Revised 9/2008 for RB 1.01 ' Revised 1/2009 to simplify the code

[start] Cls Call enableCookies

HTML " Please log in. "

Print "Username:" TextBox #user, "" Print

Print "Password:" PasswordBox #pass, "" Print

Checkbox #reme, "Remember me", 0 Print Button #login, "Log in", [logIn]

HTML " 

"

Wait

[logIn] user$ = #user Contents$ pass$ = #pass Contents$ reme = #reme Value 'TODO: Authenticate user. Cls Call enableCookies HTML " Welcome, "+user$+"! " If reme Then ' Save info in a cookie. HTML "  " Else ' Delete info from cookie. HTML "  " End If    Link #logout, "Log out", [logOut] Wait [logOut] Cls HTML " Come back soon! " Link #again, "Log in again", [start] Wait Sub enableCookies HTML "  " End Sub code