![]() |
Session destroyed after post from different ip - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: CodeIgniter 4 (https://forum.codeigniter.com/forumdisplay.php?fid=28) +--- Forum: CodeIgniter 4 Support (https://forum.codeigniter.com/forumdisplay.php?fid=30) +--- Thread: Session destroyed after post from different ip (/showthread.php?tid=79127) |
Session destroyed after post from different ip - z10892 - 04-24-2021 Hello. My session gets destroyed when I send form using post method from website that is hosted on different ip. If I send it from other website with same ip or change method to get then session is not destroyed. Result is the same no matter on url destination. Is it some kind of additional security protection or do I have some bug? I was trying to find the reason of this behavior but failed to do so. I'm using version 4.1.1 with csrf disabled RE: Session destroyed after post from different ip - InsiteFX - 04-24-2021 Sessions will not work across domains. Best bet is to save the data in a shared database then pull it. RE: Session destroyed after post from different ip - z10892 - 04-25-2021 I'm not sure if we understood each other. I'm logged on domain a, then I go to domain b and send form to domain a, after that I get logged out on domain a. RE: Session destroyed after post from different ip - FlorianL - 04-26-2021 On localhost ? If you change the sessionCookieName on config/App for one of your domain the problem persist ? RE: Session destroyed after post from different ip - z10892 - 04-26-2021 I'm working on remote. Session cookie name is correct. RE: Session destroyed after post from different ip - InsiteFX - 04-26-2021 You can read this it is a solution for a similar problem like yours. How to Track your Users over Several Domains? RE: Session destroyed after post from different ip - z10892 - 04-26-2021 I'm not trying to share cookies across domains. I'm just trying to keep original session on domain "a" after posting some data from domain "b". Currently session gets destroyed after posting data. I can't find a reason why is this happening. RE: Session destroyed after post from different ip - InsiteFX - 04-26-2021 1) read the server log files. 2) set the env file to CI_ENVIRONMENT = development for debugging, rename to .env. 3) turn on CodeIgniters logger set the threshold t0 9. 4) hit F12 in your web browser to see what is going on console and network tabs. Also Sessions do use Cookies. RE: Session destroyed after post from different ip - z10892 - 04-27-2021 It was caused by cookieSameSite set to LAX. Thanks for trying to help. RE: Session destroyed after post from different ip - InsiteFX - 04-27-2021 Glad you got it fix that's CORS doing it's thing again. |