Rollbase Mobile: login problems after logging out

Posted by Harrie Kuijper on 04-Nov-2014 05:40

Hi all,

I'm having a problem with the Mobile app I'm developing. To reproduce, login into the mobile app, press the back button of your phone (or go back in browser, when using mobile preview), and log back in. Now the following 'error' appears:

HTTP Status 200: Failed to log in. Attempted to call login() on a Session object that is already logged in. status (from jqXHT) :200 statusText (from jqXHT) :OK responseText (from jqXHT) :{"status_code":"200", "status_txt":"Successfully Logged in ." }

It seems that the authentication process was succesful, but somehow throws an error because I'm already logged in. I tried adding an eventhandler to the Backbutton event, which calls the LogoutService, but this didn't work out. When clicking the Logout button (instead of pressing the phone's backbutton), everything works fine.

Does someone have an idea how to solve this?

Posted by Anil Kumar on 04-Nov-2014 10:59

Hi Harrie,
 
There is an issue in the default Backbutton behavior added for the mobile page. The events added for the Backbuon are not honored and always it moves to previous page even though we have some custom actions added for the specific button (say adding an alert statement).
 
It is observed that the problem is with the libraries version possessed by mobile application. Currently the apps are pointed to 3.0 version and the fix is available 3.1 version. I have reported an issue for this problem.
 
Note: The libraries version upgrade will happen as part of the Rollbase Mobile 3.1 release which is scheduled for Dec 2014.
 
Thanks and Regards,
Anil Kumar.
 
[collapse]
From: Harrie Kuijper [mailto:bounce-hkuijper@community.progress.com]
Sent: Tuesday, November 04, 2014 6:13 PM
To: TU.Rollbase@community.progress.com
Subject: RE: [Technical Users - Rollbase] Rollbase Mobile: login problems after logging out
 
Reply by Harrie Kuijper

Hi Anil,

Thanks for your answer.

Adding the MyLogoutButton doesn't solve my problem. The logout button shown in the app already works well, but I'm facing the issue when I use the physical back button of Android. Since the back button is a common feature in Android, a lot of Android users will use it and therefore run into this error. The error is reproducible in the emulator by pressing backspace in DetailPage.

Like I said in my first post, I tried the following:

imagizer.imageshack.us/.../CLR0x8.png

But it didn't work out.

Stop receiving emails on this subject.

Flag this post as spam/abuse.

[/collapse]

All Replies

Posted by Anil Kumar on 04-Nov-2014 06:07

Hi Harrie,
 
As we are not calling the Logout operation (instead invoking the browser back button) and this do not actually clear the session of the Rollbase mobile application, thus an error is shown in mobile emulator when logging into same session which is expected behavior as the Rollbase app is session bounded.
 
I tried adding the ‘DefaultSessionLogout’ (SessionService_Logout) event for a custom button (say My Logout) and clicking this button performed proper logout operation. i.e., after clicking this button the navigation is moved to login page and when we provide proper username, password the AppDetailPage is shown properly in the emulator.
 
Attached Rollbase application XML for reference.  
 
[View:~/cfs-file.ashx/__key/communityserver-discussions-components-files/25/CustomLogout_5F00_v2.xml:550:0]
 
Thanks and Regards,
Anil Kumar.
 
[collapse]
From: Harrie Kuijper [mailto:bounce-hkuijper@community.progress.com]
Sent: Tuesday, November 04, 2014 5:12 PM
To: TU.Rollbase@community.progress.com
Subject: [Technical Users - Rollbase] Rollbase Mobile: login problems after logging out
 
Thread created by Harrie Kuijper

Hi all,

I'm having a problem with the Mobile app I'm developing. To reproduce, login into the mobile app, press the back button of your phone (or go back in browser, when using mobile preview), and log back in. Now the following 'error' appears:

HTTP Status 200: Failed to log in. Attempted to call login() on a Session object that is already logged in. status (from jqXHT) :200 statusText (from jqXHT) :OK responseText (from jqXHT) :{"status_code":"200", "status_txt":"Successfully Logged in ." }

It seems that the authentication process was succesful, but somehow throws an error because I'm already logged in. I tried adding an event to the Backbutton event, which calls the LogoutService, but this didn't work out. When clicking the Logout button, everything works fine.

Does someone have an idea how to solve this?

Flag this post as spam/abuse.

[/collapse]

Posted by Harrie Kuijper on 04-Nov-2014 06:42

Hi Anil,

Thanks for your answer.

Adding the MyLogoutButton doesn't solve my problem. The logout button shown in the app already works well, but I'm facing the issue when I use the physical back button of Android. Since the back button is a common feature in Android, a lot of Android users will use it and therefore run into this error. The error is reproducible in the emulator by pressing backspace in DetailPage.

Like I said in my first post, I tried the following:

imagizer.imageshack.us/.../CLR0x8.png

But it didn't work out.

Posted by whenshaw on 04-Nov-2014 09:31

Hi Harrie,

I can't give you a specific suggestion, but I guess there are 2 possibilities here. One is the idea that you and Anil have already discussed of logging out when the user presses the back button. However, I could not get that to work either -- when I tried your approach (in my own project) of invoking logout on the firing of the Backbutton event, the Backbutton event did not fire when I used backspace or the browser back arrow in the emulator. If you can't get logout to be invoked when the user uses the back button, can you change the Welcome Page so that pressing the login button does not really invoke Login if there was already a successful login, and simply transitions to the Detail Page? You could set a local variable as a flag to indicate successful login -- of course, you would need to be sure to clear that flag whenever there is a logout. You would need to change your Login Button Click event so instead of doing an "Invoke service", the action is "Run JavaScript", and then invoke the login service  (or not) using JavaScript in the handler. I have not tried this yet, right now it is just an idea.

--Wayne

Posted by Harrie Kuijper on 04-Nov-2014 10:36

Hi whenshaw,

As a workaround, I was thinking in the same direction. I will try that suggestion, and keep you posted! I think I file a ticket at Progress for the "backbutton event"-issue.

Thank you.

Posted by Anil Kumar on 04-Nov-2014 10:59

Hi Harrie,
 
There is an issue in the default Backbutton behavior added for the mobile page. The events added for the Backbuon are not honored and always it moves to previous page even though we have some custom actions added for the specific button (say adding an alert statement).
 
It is observed that the problem is with the libraries version possessed by mobile application. Currently the apps are pointed to 3.0 version and the fix is available 3.1 version. I have reported an issue for this problem.
 
Note: The libraries version upgrade will happen as part of the Rollbase Mobile 3.1 release which is scheduled for Dec 2014.
 
Thanks and Regards,
Anil Kumar.
 
[collapse]
From: Harrie Kuijper [mailto:bounce-hkuijper@community.progress.com]
Sent: Tuesday, November 04, 2014 6:13 PM
To: TU.Rollbase@community.progress.com
Subject: RE: [Technical Users - Rollbase] Rollbase Mobile: login problems after logging out
 
Reply by Harrie Kuijper

Hi Anil,

Thanks for your answer.

Adding the MyLogoutButton doesn't solve my problem. The logout button shown in the app already works well, but I'm facing the issue when I use the physical back button of Android. Since the back button is a common feature in Android, a lot of Android users will use it and therefore run into this error. The error is reproducible in the emulator by pressing backspace in DetailPage.

Like I said in my first post, I tried the following:

imagizer.imageshack.us/.../CLR0x8.png

But it didn't work out.

Stop receiving emails on this subject.

Flag this post as spam/abuse.

[/collapse]

This thread is closed