Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8240081
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T20:21:57+00:00 2026-06-07T20:21:57+00:00

Could somebody inform me if this is a proper way to implement a user

  • 0

Could somebody inform me if this is a proper way to implement a user session for an app:

If I have an iOS app where I want to provide certain functionality only to users who have logged in, and some other kind of functionality to users who haven’t (say read vs. write functionality), then does the following architecture make sense…

1) I want to create global BOOL variable, e.g. loggedIn, that I can check against any time an app user wants to perform one of the functions under the “Authenticated-User-Only” list. I would like to know where to store this BOOL. Is NSUserDefaults best practice for storing a global boolean?

2) I’m trying to implement the Facebook iOS SDK, so when I return from a SSO with FB and the FB user has verified my app, can I then use that to set my global BOOL loggedIn to then be used throughout the app?

Thank you in advance.

Note –

This is all client-side, natively within the app. There are no webviews happening, the registry is going to query a server to return whether the user is valid or not.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T20:21:59+00:00Added an answer on June 7, 2026 at 8:21 pm

    You could use a BOOL that’s global, however that’s more work then you’ll have to do.

    Instead, you can use the isSessionValid method that is provided by the Facebook iOS SDK to check if the user’s session is valid.

    To do this you can simply do the following in any classes that need this check to be performed:

    YOURAPPDELEGATE *delegate = (YOURAPPDELEGATE*)[[UIApplication sharedApplication] delegate]; 
    
    if ([appDelegate.facebook isSessionValid]) {  //Session is valid, facebook is the name of the instance of Facebook that is set in your app delegate, providing that's where you do the login handling, as per the tutorial on Facebook's developer site 
        DO STUFF
    }
    else { //Session is NOT valid
        DO OTHER STUFF
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Could somebody tell me what is the proper way to convert a NSString* to
Could somebody kindly explain this to me, in simple words: there is no way
Could somebody recommend to me the proper way of writing filter functions for ajax
could somebody please explain why this happens? I have written the following: 1) a
could somebody please take a look at this http://jsfiddle.net/bloodygeese/EzkFR/1/ My aim is to on
Could somebody please explain what this notation is in javascript? What is function(d) doing?
Could somebody please help me get Clang up and running? (I don't have 3.2)
What does this statement meaning, could somebody elaborate me on this please (@diplomaPercentage is
Could somebody provide a simple explanation of the chain of responsibility pattern? I found
Could somebody please explain the meaning of this error? INFO: Scanning for root resource

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.