Mobile Apps: Identity Session/Cookie Not Maintained

Well, the login now works as it should but on iOS and in Browser the session is not being maintained.

Once you go to a new page the identity session/cookie is cleared.

Again, this is only in browser preview and on iOS emulator. Android emulator is working fine.

Mobile apps are usually a single page apps Brad. You don’t go to new pages, you just load different views dynamically.

That is also another great advantage of Framework7 and it’s routing.

Unfortunately I am using Bootstrap and routing is not available. I wish I could use FW7 but it's just not there in Wappler yet. Simplest things are missing and no documentation on creating SPA apps in FW7. So many things missing and bugs that it's not even possible to use FW7. Sorry man.

1 Like

True

1 Like

I hope I haven't wasted mine and @patrick's time over the last few days. Appears my over the top happiness with Wappler this morning may have been a bit premature. If I had known Bootstrap was not an option I wouldn't have wasted so much time and just hired a third party to build our app in the first place. Feeling a bit disappointed. If you can't build an app with Bootstrap it shouldn't even be an option in Wappler.

Bootstrap is fine Brad but you just have to build it as SPA - remember everything is loaded in your app - not from a web server.

You are just getting your data from remote.

Brad all of our current production mobile applications are built upon the Bootstrap framework with Wappler and we have zero issues at all.

But how can you do aSPA so if routing isn’t available for bootstrap. See my link above.

Sorry Brad have never built a SPA (sort of reminds me of the old Frames approach), and never done anything with FW7 (looks old before you even begin). Can’t help with routing either so all in all today I’m quite useless to you hahaha…

Big tip is build a simple app first. Get it working at the basic level. Then build upon it but back it up a lot. About all the advice I can give you right now sir.

2 Likes

Ok, I was up late last night with a few beer and I think I found a work around for the identity session.

I have no idea why the identity session can’t be carried across pages. But what I did was create a session variable called ‘clientid’ that gets set on successful login using the identity. So basically what it does is create a new session variable that is identical to the identity. This session gets carried across pages without issue. In all my testing this morning it seems to work perfectly. I don’t know if that is a good way to do it or not but it works.

Brad I think you are confusing a lot of things here…

Why do you want and need a session for your html pages? They are all already bundled with your app. You don’t have and need a web server for a mobile app.

The only sessions you need are for retrieving the remote server connect actions and those sessions are carried together with the server action and available in it.

I need a way to filter the data based on user. How else can I show data that is only for that specific user?

User logs in and should only see data that is specific to themselves.

So in the server action and the session is already there and available. When you use the security provider in your server action.

You lost me.

When I go to a new page it loses all identity sessions. Where are these sessions available and how do I access them if they are there? This shouldn’t be so difficult to filter a recordset by user identity.

Brad you just filter your query using the logged user identity. It’s available in your server action(s), you don’t pass it across your app front end (pages).

I understand that …

I log in … that page has a user identity value fine. Everything I show and hide on that login/index page works fine.
I go to a different page to say show users appointments. Then yes, the identity is selectable but it has no value. The value does not transfer to new pages.

If this could be done as a SPA app it would be easy. Unfortunately routes aren’t available with Bootstrap.

The value is not transferred across your pages. It’s on the server side in the server actions, so all the filtering is done only there and you just send this foltered data back to the pages.

Well, then there is a bug. It doesn’t work.

How do you verify this? This server actions will have the same session - just use it in the server actions

This works using my method of creating a new session variable and give it the same value as identity on login. It works across pages.

Using the security identity in the query only works on the login/index page. Going to a new page the recordsets are empty.