Ah, thank you so much :) 

On Friday, August 25, 2017 at 1:56:33 PM UTC+2, Anthony wrote:
>
> That's not what the remember me option is supposed to do -- it does not 
> automatically fill in the login form if you are logged out. Without the 
> remember me option checked, a login lasts only as long as the browser 
> session -- if you close the browser and then open it again, you will no 
> longer be logged in (because login status is maintained in a session 
> cookie, which expires with the browser session). The remember me option 
> changes the cookie from a session cookie to a non-session cookie with a 
> longer expiration -- so even if you close the browser and come back 
> sometime later, you will still be logged in.
>
> However, even if you log in with the remember me option checked, if you 
> explicitly log out, you will not remain logged in -- you must log in again 
> to be re-authenticated.
>
> Anthony
>
> On Friday, August 25, 2017 at 2:00:55 AM UTC-4, Simona Chovancová wrote:
>>
>> Apparently some other code I had in controller was breaking functionality 
>> of this, now I reached the point when it actually displays the remember 
>> button, although upon successful login and log out it doesn't actually 
>> remember my info and nothing gets filled into the login form. 
>>
>> On Thursday, August 24, 2017 at 5:04:02 PM UTC+2, Anthony wrote:
>>>
>>>
>>> controller.py
>>>> def index():
>>>>     auth.settings.remember_me_form=True
>>>>     auth.settings.long_expiration = 3600*24*30
>>>>     form = auth()
>>>>     return dict(form=form)
>>>>
>>>> view.html
>>>>     {{=form.custom.begin}}
>>>>     {{=form.custom.widget.email}}
>>>>     {{=form.custom.widget.password}}
>>>>     {{=form.custom.widget.remember_me}}
>>>>     {{=form.custom.widget.submit}}
>>>>     {{=form.custom.end}}
>>>>
>>>
>>> I cannot reproduce the problem -- using the exact code above, I do see a 
>>> checkbox added to the form. However, you have not included any of the field 
>>> labels, so the checkbox has no label (the label is in 
>>> form.custom.label.remember_me).
>>>
>>> Also, there is no form.custom.widget.submit, so you probably see the 
>>> word "None" right after the checkbox instead of seeing the login button. 
>>> Instead, it should just be form.custom.submit.
>>>
>>> Finally, when you call auth() and there are no URL args to indicate 
>>> which auth action you want (i.e., login, register, etc.), auth will force a 
>>> redirect to the current URL with /login appended. If you don't want that 
>>> and instead just want to display a login form on the index page, then 
>>> instead of calling auth(), call auth.login().
>>>
>>> Anthony
>>>
>>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to