Search the archives!
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Javascript] automatic filling of login field
- From: bernu at lptmc.jussieu.fr (Bernu Bernard)
- Subject: [Javascript] automatic filling of login field
- Date: Fri May 4 14:38:04 2007
Le 4 mai 07 ? 19:36, Mike Dougherty a ?crit : > On 5/4/07, Bernu Bernard <bernu@xxxxxxxxxxxxxxxx> wrote: > The autocomplettion works perfectly with a standard submit, where a > new html page is sent. > > The question is : how to do that with ajax ? > In ajax-like method, the problem comes from the onsubmit of the form > which ends with a return false and thus prevent the browser from > saving the login/password. > > It would be helpful to see an example as Hassan suggested. I am > not sure an AJAX login is an ideal strategy. > > To avoid the username+password in something as easily manipulated > as a cookie, we use identification numbers which have no obvious > meaning (as well as salted hashing to prevent sequential > discovery) That number is a key to retrieve user information from > the SQL database upon return to our site. To be truly secure, even > if you think you know who someone is (so you can prefill login > info) it is better to ask again for their password (in case someone > else is using their computer) ex: I think it's disgraceful that > my gmail account stays logged in across browser instances unless I > specifically log out. If I don't take an active measure to secure > my email, anyone accessing my computer (at work) can get to my > email. I urge you to not follow Google's bad example of logon > security. This is a working solution of what I wanted : <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="content-type" content="text/html;charset=UTF-8" /> <title>login test</title> </head> <body> <form method="post" action="http://localhost/cgi-bin/mycgidecoder" enctype="multipart/form-data" accept-charset="utf-8" name="mainform" id="mainform" target="jstarget" > <input type="text" name="login" /> <input type="password" name="password" /> <input type="submit" /> </form> <iframe id="jstarget" name="jstarget" style="background:#f0f ; border:solid 1px ; width:300px ; height:300px" src="qblank.html">hello</iframe> </body> </html> where the iframe can be of size 0. I put sizes to verify how it works. The qblank.html can be : <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <title>qblanck</title> </head> <body> hello </body> </html> "mycgidecoder" just return the following that I can see in the iframe "Content-type: text/plain ; charset=UTF-8 { result:\"ok\"} " I tested it in Safari, Firefox and Opera (need the magic stick), not test in IE6-7. Now, I can change login and password. Each time I'm asked if I wanted to save the settings. If I respond yes then, when I ask for the page later, these two field are automatically filled by Safari, Firefox. Bernard one of the http://www.quomodo.com developer !-) > _______________________________________________ > Javascript mailing list > Javascript@xxxxxxxxxx > https://lists.LaTech.edu/mailman/listinfo/javascript -------------- next part -------------- An HTML attachment was scrubbed... URL: https://lists.LaTech.edu/pipermail/javascript/attachments/20070504/0af4b806/attachment.html
- References:
- [Javascript] automatic filling of login field
- From: Bernu Bernard
- [Javascript] automatic filling of login field
- From: Hassan Schroeder
- [Javascript] automatic filling of login field
- From: Bernu Bernard
- [Javascript] automatic filling of login field
- From: Mike Dougherty
- [Javascript] automatic filling of login field
- Prev by Date: [Javascript] automatic filling of login field
- Next by Date: [Javascript] IE7 javascript profiler?
- Previous by thread: [Javascript] automatic filling of login field
- Next by thread: [Javascript] IE7 javascript profiler?
- Index(es):