I have problem with session on Safari.
My server is Apache Laravel on a dedicated AWS.
Admin is angularJS on an Windows XAMPP server.
My problem occur on UAT Testing site (like staging)
Live server do not have problem.
The cause is so simple but it take me about 2-3 day to figure of what the heck with Safari. It caused by domain admin web and API do not match. So the fix is so simple and in the real app it rarely apear because normaly api and web app use same domain name abc.com. But on testing, sometime we have to work with IP or not real domain name. This post I note something that I've learned when debug Why Safari could not write session (or more exactly, Why session cookie do not work on safari with api server)
Cookie domain:
admin.abcxyz.test.co
api.123.vps.com
=> Default chrome work well (like allow all cookie).
But default Safari only Allow from websites I visite.
After some trial and digging, I end up with figure out the different behavior of Safari with chrome. Safari both 9 and 10 not work.
Another problems are: my staging server using a special docker container that it hard and take time to debug and manage code version , and second is that some time Safari 10 on Mac Mini can work well with session but other (Macbook or iPhone not). After quit Safari - MacMini it can not work again.
I will update why this happen and figure better way to handle this special container.
My server is Apache Laravel on a dedicated AWS.
Admin is angularJS on an Windows XAMPP server.
My problem occur on UAT Testing site (like staging)
Live server do not have problem.
The cause is so simple but it take me about 2-3 day to figure of what the heck with Safari. It caused by domain admin web and API do not match. So the fix is so simple and in the real app it rarely apear because normaly api and web app use same domain name abc.com. But on testing, sometime we have to work with IP or not real domain name. This post I note something that I've learned when debug Why Safari could not write session (or more exactly, Why session cookie do not work on safari with api server)
Cookie domain:
admin.abcxyz.test.co
api.123.vps.com
=> Default chrome work well (like allow all cookie).
But default Safari only Allow from websites I visite.
After some trial and digging, I end up with figure out the different behavior of Safari with chrome. Safari both 9 and 10 not work.
I eventually use curl to test cookie:
Another problems are: my staging server using a special docker container that it hard and take time to debug and manage code version , and second is that some time Safari 10 on Mac Mini can work well with session but other (Macbook or iPhone not). After quit Safari - MacMini it can not work again.
I will update why this happen and figure better way to handle this special container.
Comments
Post a Comment