Hi there, were you able to solve this issue?

I'm having the exact same problem.
My application is designed to work in the main domain and in a particular 
subdomain. So, the login needs to be valid for both, main domain and 
subdomain.
The code I run is exactly like yours. And it works perfectly in most 
scenarios.

However, a couple of customers using iPhone report that problem: they 
login, no error is shown (so the login was successfull), but they are 
redirected to the login page. They say it happens in Safari and Chrome 
(both running on iPhone).
I'm pulling my hair off for this, because I don't have a practical way to 
reproduce and inspect the problem.

Were you able to solve it? Would you share your experience?

Thanks in advance.
Regards,
Lisandro.

El martes, 12 de enero de 2016, 11:12:01 (UTC-3), ase...@infotrustllc.com 
escribió:
>
> Hey guys. I'm having an issue with logging users in on Safari 9.  It works 
> in Chrome and Firefox fine.  When I try to log in, it will take me back to 
> the login screen and no errors are shown.  This leads me to believe it is 
> logging me in and then losing the session or something.  Also, we are 
> changing the cookie to be good for all subdomains.  I have tracked it down 
> to have something to do with us saving sessions in the database. Here is 
> the code where we are changing the domain:
>
> if not request.env.remote_addr in ['127.0.0.1', 'localhost']:
>     if "session_id_name" in response:
>         if response.session_id_name in response.cookies:
>             response.cookies[response.session_id_name]['domain'] = ".
> mydomain.com"
>
> I have noticed that in all browsers, this cookie is on the system twice. 
>  They have the same name.  In Firefox and Chrome, the values of the two 
> cookies are different from each other.  In Safari, they are the same value. 
>  The only difference is the domain that the cookie is good for.  I have 
> looked in the database to see what happens when I log in.  In Chrome and 
> Firefox, it keeps the same row but updates the unique_key.  This new 
> unique_key is in the value of the cookie where the domain is for all 
> subdomains.  The other cookie is the old value.  However, in Safari, the 
> cookies have the same value.  When I log in, instead of updating the 
> previous cookie, it creates a new row and updates the cookie to match this 
> row.
>
> Any help would be much appreciated.  Thank you in advance!
>

-- 
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 web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to