Forum: Ruby on Rails Remember me (Devise) not working for me.

576908ab294e24dadb3303a6667b8776?d=identicon&s=25 fahim patel (fahim_patel)
on 2013-07-30 09:50
(Received via mailing list)
Hi all,

I have setup all the devise configuration. But facing issue in remember
me.
I check remember me checkbox before sign in and I can see cookie is
created
and user table is also get updated .

But when I logout no sign in detail is present in email and password
input
box , and cookie also get destroyed.

I uncomment below line code also -
# The time the user will be remembered without asking for credentials
again.
  config.remember_for = 2.weeks

Thanks for help.


Best Regards
Fahim Babar Patel
576908ab294e24dadb3303a6667b8776?d=identicon&s=25 fahim patel (fahim_patel)
on 2013-07-30 10:04
(Received via mailing list)
On Tuesday, July 30, 2013 1:18:16 PM UTC+5:30, Fahim Patel wrote:
> I uncomment below line code also -
>
When I sign_in then save password prompt occur and when I save it and
logout then I can see email and password is present there.
Don't know why it is not working with remember me check box ?

Any help will appreciate.

Thanks

Best Regards
Fahim Babar Patel
Bdf1f2ad97e7b9c9db1fa70e3cef48bf?d=identicon&s=25 bacrossland (Guest)
on 2013-07-31 03:23
(Received via mailing list)
On Tuesday, July 30, 2013 2:48:16 AM UTC-5, Fahim Patel wrote:
> I uncomment below line code also -
>
Hi Fahim,

remember_for is for automatic login. If you log out it doesn't apply.
Having the credentials auto fill in the fields after a logout is handled
by
the browser. Here is a link to the code that uses it:
https://github.com/plataformatec/devise/blob/maste...

The comment block has instructions on how the setting is used.

    # Rememberable manages generating and clearing token for remember
the user
    # from a saved cookie. Rememberable also has utility methods for
dealing
    # with serializing the user into the cookie and back from the
cookie, trying
    # to lookup the record based on the saved information.
    # You probably wouldn't use rememberable methods directly, they are
used
    # mostly internally for handling the remember token.
    #
    # == Options
    #
    # Rememberable adds the following options in devise_for:
    #
    #   * +remember_for+: the time you want the user will be remembered
without
    #     asking for credentials. After this time the user will be
blocked and
    #     will have to enter his credentials again. This configuration
is also
    #     used to calculate the expires time for the cookie created to
remember
    #     the user. By default remember_for is 2.weeks.


 If you set this option it should remember you between browser closes.
Again for your id and password to be auto filled in the field between
logouts, which are different than browser closes or navigating away from
the page, that is handled by the browser.

I hope this helps.

Thanks,
Bryan
576908ab294e24dadb3303a6667b8776?d=identicon&s=25 fahim patel (fahim_patel)
on 2013-07-31 07:24
(Received via mailing list)
Thanks lot  bacrossland  for your input.
576908ab294e24dadb3303a6667b8776?d=identicon&s=25 fahim patel (fahim_patel)
on 2013-07-31 07:26
(Received via mailing list)
It means remember me is working
I am confusing between remember me and save password prompt which come
after successful sign in.
Question's

   1. Did Save password prompt which come after successful sign in is
   default feature of browser or is effect of rememberable feature ?
   2. How does remember me work than ?


Thanks

Best Regards
Fahim Babar Patel
Bdf1f2ad97e7b9c9db1fa70e3cef48bf?d=identicon&s=25 bacrossland (Guest)
on 2013-07-31 16:07
(Received via mailing list)
Questions

>
>    1. Did Save password prompt which come after successful sign in is
>    default feature of browser or is effect of rememberable feature ?
>    2. How does remember me work than ?
>
> Answers

1. It is default feature of the browser. The browser will ask you if you
want your password remembered for this site. If you click yes then it
will
store the site URL, login ID and password into a keychain file. That
keychain file will be used to auto populate the login fields the next
time
you come navigate to the page and are presented with the login prompt.

2. Remember me stores your authentication token as a cookie on your
system.
As long as you don't click logout, clear your cookies, or have not
exceeded
the time that the cookie will be stored each time authentication is
prompted, for instance if your session times out, then you will be auto
logged back in. Its function is more like "keep me logged in".
576908ab294e24dadb3303a6667b8776?d=identicon&s=25 fahim patel (fahim_patel)
on 2013-07-31 17:34
(Received via mailing list)
Thanks lot bacrossland .

Best Regards
Fahim


Answers

1. It is default feature of the browser. The browser will ask you if you
want your password remembered for this site. If you click yes then it
will
store the site URL, login ID and password into a keychain file. That
keychain file will be used to auto populate the login fields the next
time
you come navigate to the page and are presented with the login prompt.

2. Remember me stores your authentication token as a cookie on your
system.
As long as you don't click logout, clear your cookies, or have not
exceeded
the time that the cookie will be stored each time authentication is
prompted, for instance if your session times out, then you will be auto
logged back in. Its function is more like "keep me logged in".
Bdf1f2ad97e7b9c9db1fa70e3cef48bf?d=identicon&s=25 bacrossland (Guest)
on 2013-08-01 12:44
(Received via mailing list)
On Wednesday, July 31, 2013 10:32:57 AM UTC-5, Fahim Patel wrote:

> Thanks lot bacrossland .
>
> Best Regards
> Fahim
>
>
>>
You're welcome.
Please log in before posting. Registration is free and takes only a minute.
Existing account

NEW: Do you have a Google/GoogleMail, Yahoo or Facebook account? No registration required!
Log in with Google account | Log in with Yahoo account | Log in with Facebook account
No account? Register here.