Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Auto login of the Page

 
Ravi Kiran Va
Ranch Hand
Posts: 2234
Eclipse IDE Firefox Browser Redhat
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi ,

I want to develop Auto login Page .

for example it consists of two fields say a username and a password textfields.

Now i want to provide a check box under it with Label Do You want to remember ?

Which automatically logs me if i open the site again .

Please give me an idea as how to remember the username and password again when the user comes .

Thank You .


 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You'll need to do this with a cookie (search the forums for many examples). A fairly insecure mechanism, but it will do what you ask (assuming the same user uses the same PC to access your site and they don't clear down cookies).
 
Ravi Kiran Va
Ranch Hand
Posts: 2234
Eclipse IDE Firefox Browser Redhat
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you paul .

I found the script with respect to this requirement .
But please tell me how this particular line can be useful in this ??

Calling a Javascript function on a checkbox (Remember Me) on to the form .



But can you please tell me what is the meaning of this line with so many parameters cookie.setMaxAge(365 * 24 * 60 * 60);

Thanks .

 
Nikhil Shah Jain
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is stating the max age of the cookie for 1year i.e.,
365 days* 24 hour s* 60min *60secs
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There's only one parameter there, it happens to be an arithmatic expression.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic