> On 12/29/05, Priya Saloni <[EMAIL PROTECTED]> wrote: > > > > Hi there, > > > > I have a requirement like this where i need to remember the > user names > > for a computer.Can some one suggest me how to implement this using > > struts based framework.. > > > > Example: > > > > *Username: * *Password: * Remember my BCP username. > > > You could use a cookie to store the username on the users computer. > It is saved by the browser actually so if the user logs in > with IE and then with Mozilla, Mozilla won't know about the > cookie set in IE. > > Look at the servlet API: > > javax.servlet.http.Cookie > javax.servlet.http.HttpServletRespone.addCookie(Cookie) > javax.servlet.http.HttpServletResponse.getCookies()
Also, there's a good LGPL javascript library that has all the important cookie functions (as well as a ton of other goodies) here: http://cross-browser.com/ If you want to let the user auto-login (assuming it's not a site on which security is critical), then a common thing to do is to store the username as one cookie, and a HASH of username+password as another. It's important not to just store the password in plaintext, or a hash of the password alone (because there are dictionaries of hashes of 8 or 9 characters available). Best, Daniel --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]