Don Tomato
Don Tomato

Reputation: 3529

Auto Authentication

I am using Facebook, GMail and many other services and for each such service I have to enter my login and password. But only first time. After this first time the browser remember a login and a password and an authentication occurs automaticaly every time when I open this site.
How can I make this possibile for my site? Now I have to enter a login/pwd every time after I restart the browser.

Upvotes: 0

Views: 64

Answers (2)

Kevin Bedell
Kevin Bedell

Reputation: 13404

I'd recommend using Devise for authentication generally.

While you can probably code your own authentication features with no issue, Devise makes rolling out these new features a lot faster. For example, it's not difficult to setup these features:

  • Making 'Remember Me' optional so users can choose whether or not they stay logged on using a permanent cookie.
  • Automatic login using a token-based url (unique token per user account)
  • Integration with facebook, twitter, linkedin, etc via Omniauth
  • Allowing users to reset their passwords
  • Changing password security rules
  • etc, etc, etc.

Moreover, since it's very widely used it's very solid and debugged. There are many, many 'eyes on the code'.

Upvotes: 0

Dave Newton
Dave Newton

Reputation: 160211

Search the web for "cookie login". Things like authlogic and devise (since you mention Rails) have this baked (ahem) in. You most likely should not be rolling your own authentication code.

Upvotes: 1

Related Questions