Session destroyed when returning from external link |
Hi
I have a CI4 app where I use a very basic auth system This ci4 application is located in a subdomain I login the user and store some vars in session, etc. Somewhere in the codeigniter app, I show a button to the user which opens (in new tab) a payment processor website. This payment processor has some settings like return_fail_url and/or return_success_url When user pays successfuly, it returns to my ci4 return_success_url If user cancels the payment, it returns to my ci4 return_fail_url The problem I'm having is that when user returns from the payment processor website (success or fail), all the session data is lost User has to login again I thought about debugbar. I disabled it but this behaviour keeps happenning Any idea how to solve or debug this? Thanks
Enrique
https://beza.com.ar
Investigate "samesite cookie".
(06-22-2023, 02:58 PM)kenjis Wrote: Investigate "samesite cookie". Hi I've done the research, but cannot make the cookie to be set to None in the browser I've set the following into my .env file Code: #-------------------------------------------------------------------- I've also set same options/values in app\Config\Cookie.php app\Config\Security.php app\Config\App.php But browser keeps setting it to Strict (I've tested all after setting options and session keeps being destroyed upon returning from payment platform)
Enrique
https://beza.com.ar Code: cookie.secure = true PHP Code: <?php
By the way, cookie.samesite = 'None' is the lowest security level.
So it is better not to use as much as possible.
EDIT: I could finally solve the issue. There was a f.... line hidden in some apache config file which looks like I've commented previously. Commented it again and now it is working
Code: Header edit Set-Cookie ^(.*)$ $1;HttpOnly;Secure;SameSite=None Thanks a lot for all the clarifications Code: #-------------------------------------------------------------------- Thanks again
Enrique
https://beza.com.ar |
Welcome Guest, Not a member yet? Register Sign In |