I have a hybrid app which uses Ionic and IBM's Mobilefirst platform. During login we get a cookie from the authentication service. I have to remove this cookie on logout or next time the user can log in even with incorrect credentials.
So during logout I call WL.Client.reloadApp()
before going back to login screen. This clears the cookies and then login works correctly in Android and browsers. But in iOS cookies aren't cleared on reload and having searched I came across a solution to clear cookies using native code.
But my confusion is where do I add this native code? There are a few initialization methods in my application's default .m file. I have tried adding the code to clear cookies in -(void)wlInitDidCompleteSuccessfully
. But this block doesn't seem to be executed on reloading.
Any suggestion on what I should try to fix this problem.
Two options: