0
0
Firebasecloud~20 mins

User session management in Firebase - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Firebase Session Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
service_behavior
intermediate
2:00remaining
Firebase session expiration behavior

What happens when a Firebase user session token expires?

AThe session token is silently refreshed without user interaction.
BThe user is automatically signed out and must sign in again.
CThe user session remains active indefinitely until manually signed out.
DThe app crashes due to invalid token error.
Attempts:
2 left
💡 Hint

Think about how Firebase manages tokens behind the scenes.

security
intermediate
2:00remaining
Securing Firebase sessions on client devices

Which practice best protects Firebase user sessions on client devices?

AUse Firebase SDK's built-in session management without manual token storage.
BSave the session token in a cookie without HttpOnly flag.
CStore the Firebase ID token in localStorage for easy access.
DEmbed the session token directly in URLs for API calls.
Attempts:
2 left
💡 Hint

Consider what the Firebase SDK does by default to keep sessions secure.

Architecture
advanced
2:00remaining
Designing multi-device session sync with Firebase

You want users to stay signed in across multiple devices and see session changes instantly. Which Firebase feature helps achieve this?

AUse Firebase Authentication with Realtime Database listeners to sync session state.
BUse Firebase Authentication with Cloud Firestore offline persistence only.
CUse Firebase Authentication with onAuthStateChanged listener for real-time updates.
DUse Firebase Authentication with manual token polling every minute.
Attempts:
2 left
💡 Hint

Think about how Firebase notifies apps about authentication state changes.

Configuration
advanced
2:00remaining
Configuring Firebase session persistence modes

Which Firebase Auth persistence mode keeps the user signed in only during the current browser tab session?

Afirebase.auth.Auth.Persistence.LOCAL
Bfirebase.auth.Auth.Persistence.SESSION
Cfirebase.auth.Auth.Persistence.NONE
Dfirebase.auth.Auth.Persistence.PERMANENT
Attempts:
2 left
💡 Hint

Consider the difference between session and local storage persistence.

Best Practice
expert
2:00remaining
Handling user sign-out to prevent session reuse

After a user signs out in Firebase, what is the best practice to prevent session reuse or token leakage?

AReload the app without signing out to keep session intact.
BOnly call firebase.auth().signOut() without clearing any local data.
CManually delete the refresh token from Firebase backend after sign-out.
DCall firebase.auth().signOut() and clear all local app data related to the user.
Attempts:
2 left
💡 Hint

Think about what happens if local data remains after sign-out.