I am creating a app in ionic2. I am facing an issue that on successful login in the app, if I refresh the page it again forces me to login screen but it should not as I have been logged in.
I have used Ionic 2 with menus as a kick start.
Steps I did:
Set root page as Loginpage insteed of Page1 which one was default in app.component.ts file.
rootPage: any = Loginpage;On clicking submit redirect to newly created
homepage.tsas:this.navCtrl.push(Homepage,{});In
homepage.ts, I set my root page as any of one page say page2 as:this.navCtrl.setRoot(Page2);Now on successful login I am redirected to Page2 correctly but if I reload the page at this time it again pushes me back to login page (but I am already logged in).
So the question is that how to overcome this issue?
What is the better approach for login authentication in ionic2.