Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sudden change in behavior? #8

Closed
cstromme opened this issue Aug 20, 2010 · 16 comments
Closed

Sudden change in behavior? #8

cstromme opened this issue Aug 20, 2010 · 16 comments

Comments

@cstromme
Copy link

So I've been using this framework to login my user, and then loading UIWebViews to display some of the standard Facebook pages like http://www.facebook.com/home.php?sk=h

This morning this suddenly only works the first time I start the app up. The second time I start up the app the normal webpages redirect me to login.php like if my cookies weren't valid. I even went back to my 1.0.0 release here and I get the exact same behavior there. Now if I clear all my cookies it works perfectly again until I load up the app the second time. Since nothing has changed at my end I have to assume the change is at Facebook's end?

This is my login procedure:

  • (void)socialize
    {
    if(!facebook)
    facebook = [[Facebook alloc] init];

    if(![facebook isSessionValid])
    {
    socializing = YES;
    [self login];
    }
    }

  • (void)login
    {
    NSArray *permissions = [NSArray arrayWithObjects:@"publish_stream", @"create_event", @"rsvp_event", @"manage_pages", @"user_about_me", @"", @"user_activities", @"user_birthday", @"user_education_history", @"user_events", @"user_groups", @"user_hometown", @"user_interests", @"user_likes", @"user_location", @"user_notes", @"user_online_presence", @"user_photo_video_tags", @"user_photos", @"user_relationships", @"user_religion_politics", @"user_status", @"user_videos", @"user_website", @"user_work_history", @"", @"read_stream", @"offline_access", @"friends_about_me", @"friends_activities", @"friends_birthday", @"friends_education_history", @"friends_events", @"friends_groups", @"friends_hometown", @"friends_interests", @"friends_likes", @"friends_location", @"friends_notes", @"friends_online_presence", @"friends_photo_video_tags", @"friends_photos", @"friends_relationships", @"friends_religion_politics", @"friends_status", @"friends_videos", @"friends_website", @"friends_work_history", nil];
    [facebook authorize:appId
    permissions:permissions
    delegate:self];
    }

Doing normal Graph API calls with the framework works fine, it's just loading the normal webpages that seem to be the problem. So what changed last night?

@yujuan
Copy link

yujuan commented Aug 20, 2010

We make a server side change to address http://github.com/facebook/facebook-ios-sdk/issues/#issue/5 which will take a persistent cookie instead of the session only one. So after you clear cookie and login again, everything is fine, right?

@cstromme
Copy link
Author

Just for that session, when I quit the app and restart it logs me in but doesn't let me access the pages.

I have an app in queue at Apple now using this, it would be completely horrible if it goes through the review and is broken at release.

@cstromme
Copy link
Author

Please please please fix this. :(

@yujuan
Copy link

yujuan commented Aug 20, 2010

you mean www.facebook.com? As we change to use persistent cookie which is actually mobile cookie, you would need to go m.facebook.com or touch.facebook.com...

@cstromme
Copy link
Author

Yes, the main site. The entire app relays on using the main site and not m. or touch.

PLEASE change this back. :(

The app has been in queue for 2 weeks now, even if there was some way for me to fix this in my own code I would go back at the end of the queue again.

@cstromme
Copy link
Author

Oh and I do seem to get the cookie for the main site the first time, it's only on subsequent sessions that it doesn't work.

@yujuan
Copy link

yujuan commented Aug 20, 2010

Yes, the main site accept the session-only cookie and this cookie should not be persistent. so when you first log on it is there. For mobile app, we should always use mobile cookie which is persistent and prevent user from login again and again.

@cstromme
Copy link
Author

Ok. Short and sweet. How do we solve this now?

My entire business is dependent on this app going through, and the almost 2 week wait has been rough enough. To reject the binary now, or release a broken app would basically ruin us.

We based the entire system on the current Graph API and the framework here, and now it just changed under our feet.

How can we solve this?

@yujuan
Copy link

yujuan commented Aug 20, 2010

You get the cookie for the first time but not for 2nd time, this behavior is never changed. I am not sure what is broke here. Did you save the cookie and reset it?

@cstromme
Copy link
Author

Not manually no, but it is saved automatically in the sharedHTTPCookieStorage. Again, this has worked perfectly up until this morning.

@yujuan
Copy link

yujuan commented Aug 20, 2010

I do not think the main site cookie is preserved. see http://github.com/facebook/facebook-ios-sdk/issues#issue/5 the session only cookie is not kept for the next time. Basically for the first time you query sharedHTTPCookieStorage and see all the cookies, for the 2nd time, without login, those session-only cookie would not be there. This is always the case...

I need to know more about how you use the sdk. You call authorize and then load www.facebook.com ? The best way is to let the user login everytime the app start or change to use m site if you want persistent cookie

@cstromme
Copy link
Author

Basically every time I start the app I have to run authorize:permissions:delegate: on the Facebook object, which pops up the dialog but you don't have to login again. Now this still happens, but after the dialog has disappeared and the app tells me it's logged in through the fbDidLogin delegate then it's still not logged in for the main site. That is what changed. It used to be logged in to the main site even after not having to type in the username and password.

@cstromme
Copy link
Author

I just tested here and I get the same problem with touch.facebook.com now.

@yujuan
Copy link

yujuan commented Aug 20, 2010

you can put a break point at the place you load www.facebook.com or touch.facebook.com and read the cookie from sharedHTTPCookieStorage and see what cookie is there

@cstromme
Copy link
Author

I emailed you the cookies.

@gankit
Copy link

gankit commented Nov 9, 2010

ping. I am having the same issue. Is there any solution for a persistent cookie?

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants