Asif
Posts: 0
Joined: Tue Aug 13, 2013 12:56 pm

Even after doing logout session is not expiring

Hi

I am firing logout service on the click of a button and then on the success of logout service i am navigating my app to login page. But after this if I press back button in my mobile its again taking me to the inside page and session also remains in the browser.

Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

Even after doing logout session is not expiring

Hello! I'll update.

Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

Even after doing logout session is not expiring

Could you clarify how did you configure login and logout? How did you add restriction to navigate to another page? It's not added automatically. It should be part of your app logic. Did you restrict navigating to another screen before login?

Asif
Posts: 0
Joined: Tue Aug 13, 2013 12:56 pm

Even after doing logout session is not expiring

No we have not restricted to navigate to other screen before login.

When we perform login - we call the login service and navigate to home page based upon the response.

On logout success - we navigate back to login screen .

Is there any way to restrict the logic as you said . Please could you give us a sample.

Thanks

Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

Even after doing logout session is not expiring

For example after login you can save to localStorage that user is logged in. On other pages on page Show add JS to check - if variable is not set - then navigate to login page. Reset this variable while logout.

Asif
Posts: 0
Joined: Tue Aug 13, 2013 12:56 pm

Even after doing logout session is not expiring

Hi

On the success of Logout service I am setting localStorate variable to null
and then on PageShow event of the page i am writting this JS

alert(localStorage.getItem('token'));
if(localStorage.getItem('token')==null || localStorage.getItem('token')=="")
{
alert("inside if ");
Appery.navigateTo('Login', {});
}
else
alert("inside else");

In the alert box i am getting token value as 'null' but still it is going in 'else'

can you pls chk!!

I have shared my project on a href="mailto:support@appery.io" rel="nofollow"support@appery.io/a

Asif
Posts: 0
Joined: Tue Aug 13, 2013 12:56 pm

Even after doing logout session is not expiring

Hi
I want to alter my question::

When I do logout and press back button the application should exit.
how to achieve this..!!

Pls help because this has became a show stopper for my work.

Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

Even after doing logout session is not expiring

Hi, working on it...

Anton Artyukh5836028
Posts: 0
Joined: Wed May 08, 2013 12:57 pm

Even after doing logout session is not expiring

Hello,

First of all, how you setting null?
Second, is better idea remove token from localStorage
prelocalStorage.removeItem( 'token' );/pre
After this, localStorage.getItem( 'token' ) will by equals to null and no need to compare with empty string.

Asif
Posts: 0
Joined: Tue Aug 13, 2013 12:56 pm

Even after doing logout session is not expiring

Hi . Even after setting local storage token to null the page still fetches data from page load service .
When I reach the login screen after log out service has run the user now presses the back button on the phone , this should ideally exit the app, but instead the page navigates to the previously seen page . Please help me exit the app . The work has completed by the user ans the application needs to exit

Return to “Issues”