I am using XCode4 for development.
In my applicaion I need login to a website to get the information. then by using that I have to perform some task.
I am accessing the website by REST service call. After the ASIHttpRequest passed
I am setting the user name & password like this.
[request setuserName:@"usernameString"];
[request setpassword:@"Passwordstring"];
But I am not aware of whether any session created or not.
So at the time of log out I only redirect the controller to log in screen & made the userName and password field blank.
But after logout it is taking wrong user name and password to login again.
My question:
-
Whether I have to create a session while log in and time out the session at the time of log out. How to do that?
-
In iphone application how Log in & Log out generally done?
Thanks all. This problem is solved.
At the time of log in,
ASIHTTPRequestis creating a cookie object on successful log in. If a user did not spend 1 minute inside the application and came out by tapping sign out. After that it was taking any userId and password (garbage data) to login again. It happened because the previous cookie was taking care for that.But, now at the time of sign out, I am deleting the cookie which is created at the time of log in.
I have added below code in sign out:-