Remember login. Cookies not being set, bug?

I’m so close to finishing a Framework 7 app (by the moment on v5).
And I wonder if there’s a way to keep the user logged in when they close the app.

First of all, when the login step is complete, there is no cookie being set, is that a bug? I tried to read every topic about it and I’m a little confused:

Here is what I got:


Do I need to change something from Capacitor/Android Studio? (I’ve done everything I could)

I’m using F7 v5 (but this thing is present on all versions) and App Connect beta (the stable version throws some errors)

/*!
 App Connect Framework7 v5 plugin
 Version: 1.2.2
 (c) 2023 Wappler.io
 @build 2023-03-02 13:35:47
 */
/*!
 App Connect
 Version: 2.0.0-beta.14
 (c) 2023 Wappler.io
 @build 2023-09-08 14:54:57
 */

Any guidance will be very appreciated :beers:

Exact same problem I’m also facing. Neep help.

How is the login being called? When using server connect component you have to set credentials otherwise cookies are not being send.

Just as Teodor docs says:

<form is="dmx-serverconnect-form" method="post" id="serverconnectform1" action="https://www.fran######.com/dmxConnect/api/api/login.php" site="fran########" credentials="true" dmx-on:success="serverconnectform1.reset();login1.close();main.navigate('/logged',{})">

As you can see I also had the options being called:

This has been tested on every browser, on android emulator, and android debug-apk via usb

Anyone, please?

The OPTIONS request is an extra request the browser does when accessing an external domain to check the CORS headers.

In your screenshot of the POST I see that the Response Headers contain the Cookies.

How did you define the Security Provider, I see it is called test/mobiletest. Is it located in a subfolder called test? Try making it global, the provider name is used for the cookie name and it is possible that the / in it causes the problem.

Hey @patrick. How are you?

I’m facing exact same issue with my mobile application.

Here is the dev environment:

Wappler v6.0.0 beta8
Capacitor 5.4.0
Framework 7 v5.7.14 With App Connect

A. Remote API Credentials:

  1. Security Provider

  2. CORS


    or

  3. Login API

  4. Restricted Data API

  5. Un-Restricted Data (Public)

B. Mobile App Details & Codes

  1. Unrestricted Data serverconnect3 must display : WorksD2 (working :white_check_mark:)

  2. After successful login, restricted Data serverconnect1 must load and display : Works (working :white_check_mark:). It must redirect to Logged User content page and display: Works (working :white_check_mark:)

  3. On index.html page Both restricted & non-restricted API are working. Means login is successful.

  4. But when I refresh the page, Restricted data disappears (Needs to login again to display.)

  5. In browser, I can’t find any cookies stored.

  6. All 3 API’s (Restricted/Un-restricted data API & Login API)return 200

  7. After page refresh (Restricted data Doesn’t show.) Only Un-restricted is available.

  8. capacitor.config.json

  9. package.json

@patrick Please help me to fix this issue.

I just accidently solved it :joy:

I added pull to refresh on my page. When I refreshed, I found that I’m already logged in.

Problem: I’d added No Auto Load to restricted data API serverconnect1. So after page refresh, It was not auto loading, so It was unable to display data. I had set, after login, it must load.

Solution: I just unchecked No Auto Load from serverconnect1. and after closing the app, It’s showing, means it’s already logged in.

Thanks Me for realization :joy:

But still cookies are not set. (As I can see in browser)

Hello Patrick!
I’ve already tried that with no luck.
Anything else I could try?

The domain on the cookies option (On security provider) was changed to localhost/http://localhost/http://localhost/ too as the cookies are saved there, right? Also no luck.

I’ll try to test later some web steps to retrieve data from different domains, maybe it’s a mobile project file causing troubles.

Again getting errors…

After getting wappler v6.0.0 beta9 update, I updated to latest version and extensions to latest stable channel.
Now I’m using

Wappler v6.0.0 beta9
Capacitor 5.4.1
Framework7 5.7.14 With App Connect (Only version is working)
Gradle 8.1.1

I’m successful to login but unable to get logged user data. I need to close the app and restart then I’m getting logged user data. In browser, it’s working. Error in real device only. Pull to refresh doesn’t work either to get data just after login. Needs to restart the app. @patrick Please advice solution…

Solution

Don’t use in capacitor.config.json:

Use in capacitor.config.json:

Use in package.json: