Anthony, I got it, but in my case the default value was auth.settings.remember_me_form=True anyway , so my code could possibly not work (as per your explanation), but didn't have a chance to not work due to this reason :) I found out what was going on: I had redirect in ajax error code block, i.e. I called async ajax, and after it was done and returned an error - redirect was in this error thing. This is exactly when the problem manifested. Interestingly, that even default value didn't help - I am wondering what could possibly be so messed up that defaults were not actionable due to ajax. Anyway, I had no reason for ajax altogether - it was a quick and simple call - so I replaced it with GET, and everything now works as expected. I still moved the settings to the other side, to make sure that they are not set up in an "old" request (it affected other settings, just not auth.settings.remember_me_form as it was setup correctly by default anyway).
Thank you! On Friday, January 11, 2019 at 10:59:58 PM UTC-5, Anthony wrote: > > On Friday, January 11, 2019 at 11:44:27 AM UTC-5, Vlad wrote: >> >> I am probably missing something simple: >> >> when I explicitly go to http://127.0.0.1:8000/app/default/user/register >> - I get auto-logged in after the registration. Same if I choose "register" >> on the menu. >> >> However, when the following gets executed: >> >> auth.settings.login_after_registration = True >> auth.settings.long_expiration = 3600*24*30 >> auth.settings.remember_me_form = True >> redirect(URL('app', 'default/user', 'register')) >> >> after such a registration I am not logged in, and have to login manually. >> > > Keep in mind that your model and controller code runs on each request. > Above, you set several Auth settings but then immediately redirect, which > initiates a new request -- so those settings never get a chance to take > effect. You must make those settings within the same request that is > handling the registration. > > 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.

