I am working on my first mobile app that connects to my website backend. I’m running into an issue with getting the session sid cookie set. My login API from mobile app is calling my
<form id="login1" method="post" is="dmx-serverconnect-form" action="https://ameforesight.com/api/registration/login" dmx-on:unauthorized="notifies1.warning('Unauthorized')" dmx-on:error="notifies1.danger('Uh oh, there was an error.')" dmx-on:success="notifies1.success('Nice!')" credentials="true" site="ameforesight_web">
The mobile app is running on local server. CORS is set up fine. I get a 200 response.
The problem is the session cookie doesn’t seem to get set (can’t see it in my local cookies), so it is like I am not logged in. All my other server connect tasks use Security Restrict - so I just get an unauthorized response.
How can I get the session sid cookie to set? I have tried turning off the “Secure” feature on the cookie.
What device are you trying and need to have it working? Both Android and iOS?
Are you using the security provider (backend) from Wappler?
Is your app redirecting after the successful login?
Try this:
Make a login page, but no redirect.
Place a server connect restricted query that returns a value with “no autoload”
On the login server connect dynamic success event → Load the restricted query and check if it’s a 200 status.
The reason I’m suggesting this is because I believe the cookies are working but you need to configure your mobile app for storing them.
Sorry about that the message got cut: Don’t worry about that, maybe is because your backend and frontend are on different domains (Mobile apps like capacitor work with http://localhost and your backend is on your website which has another domain).
Sure, I would be happy to send you whatever you need. I was worried the different domains may be an issue. I’m not sure how to get around that? I am currently just planning on IOS with capacitor bootstrap framework at the moment (maybe android later).
Just let me know what part of setup would be helpful. I appreciate your help on this.
Thank you! This looks promising! I will try and implement this and let you know how it goes. I really appreciate your help. I would never figure this out on my own.