Mobile Apps: Identity Session/Cookie Not Maintained

Well do you have the security identify as step in those server actions or as global action?

The identity has to come from somewhere - it doesn’t appear magically.

The Security Provider is of course in Globals. IS that what you are asking?

Another thing I don’t get is it works fine in Android Emulator but not browser preview or iOS emulator.

Brad - by just having a global definition of security provider - nothing happens by itself.

You need to add a security provider “identify” action step to turn the session into identity.

You can do that in every action or just add it to your global action (root node)

Like this?

I add that to all server connect queries?

You can do that or add it to the global server connect and it will be ran and available to you always.

image

1 Like

It might be useful to check the docs from time to time:

Actually I do have it in Globals following that tutorial.

@George @Teodor Ok, here is some screenshots and videos.

My Globals Security Identity Step …

Select the Server Action Step in my Query …

This is the query filter …

So now for the videos. When user logins in it should hide the login form and show the menu. I have also binded the identity value to the page.

Here in the Android video you will see that login is successful and I can move back and forth between pages and not lose the identity session.

Here in the iOS video you will see that it logs in correctly and has a value for the identity. But when I go to a different page and come back the identity is empty.

In browser it logs in successfully but doesn’t give identity a value.

Hope that helps show better what is happening. Am I doing something wrong?

How is your security provider setup? Do you have a high value for the cookie expiration?

I believe it’s 30. What should it be?

I will check after lunch :sunglasses:

make it something else - like 120 or so

Still no luck …

Do you reload the server connect action that fetches your identity on each page navigation? It might be cached.

Btw on iOS you can just open the safari devtools pointing to your emulator from the safari developer menu.

There you can really see all your network traffic and send and received data and cookies.

Cool trick with Safari Dev Tools …

Shows no cookie being set at all.

well with the new ios cookie proxying you won’t see them there - as they are send on the OS system level - but they are send.

You can try to display it as out put in your server action

I wish I knew the terminology better :wink:

I do have output checked on my server connect and I do display the identity value on the page. It’s fine when I login and it displays. When I go to another page and come back the identity is empty as it shows in the iOS video.

Anyways, shouldn’t you be doing beers on a Friday night? I do appreciate the help though!

Here is an update for App Connect. It is possible that the server connect is called to early and cordova was not completely ready, with the update we wait for the deviceready event on cordova.

dmxAppConnect.zip (22.7 KB)

And this goes on the App site?

yes, just replace the app connect file on the app site.

1 Like

just replace the previous file in your mobile app indeed - in the www/dmxAppConnect folder