QuizzesDomains, Cookies and TLS in Production — Concept Check
intermediate
full-stack

Domains, Cookies and TLS in Production — Concept Check

Questions on Domains, Cookies and TLS in Production. The domain layout decides whether cookies work. Two subdomains of one site is a completely different situation from two unrelated hosts, and only the first lets a normal cookie through.

8 minutes 8 questions Pass at 70%
Time Limit
8 minutes - timer starts when you begin
Change Answers Freely
Revisit and change any answer before submitting
Full Review After Submit
Correct answers and explanations shown for every question
Auto-submit on timeout
Quiz submits automatically when time runs out

Questions in this quiz

8 questions on Domains, Cookies and TLS in Production — Concept Check. Work through them here, then start the quiz to answer them and see your score.

  1. 1.Your application works perfectly on localhost but fails with a 401 error when deployed to production. What is the most likely cause?

    • AIncorrect CORS configuration
    • BDifferent domain layouts causing SameSite=Lax cookies to not be sent
    • CTLS certificates not being set up correctly
    • DIncorrect API endpoint configuration
  2. 2.You have a web app at aicancode.org and an API at api.aicancode.org. Which cookie setting ensures authentication works across both?

    • ASet Domain to .aicancode.org and SameSite to None
    • BSet Domain to api.aicancode.org and SameSite to None
    • CSet Domain to .aicancode.org and SameSite to Lax
    • DSet Domain to api.aicancode.org and SameSite to Strict
  3. 3.A developer sets a cookie with SameSite=None but forgets to set Secure. What is the consequence?

    • AThe cookie will only be sent over HTTPS
    • BThe cookie will be sent over insecure connections
    • CThe cookie will be rejected by the browser
    • DThe cookie will not be sent in cross-site requests
  4. 4.Why might a cookie set with Domain=.aicancode.org pose a security risk?

    • AIt restricts cookie sharing to only the specified subdomain
    • BIt enables cookies to be sent over insecure connections
    • CIt shares cookies with all subdomains, including those not controlled by you
    • DIt prevents cookies from being sent over HTTPS
  5. 5.If your API is hosted on a different domain than your app, what must you configure to ensure cookies work?

    • ASet SameSite to None and ensure Secure is true
    • BSet SameSite to Lax and ensure Secure is false
    • CSet SameSite to Strict and ensure Secure is true
    • DSet SameSite to Lax and ensure Secure is true
  6. 6.A developer believes that setting SameSite=Lax will allow cookies to be sent across different domains. What is the flaw in this belief?

    • ASameSite=Lax only allows cookies within the same site, not across different domains
    • BSameSite=Lax allows cookies across any domain
    • CSameSite=Lax requires Secure to be false
    • DSameSite=Lax requires cookies to be sent over HTTP
  7. 7.What is the primary reason for setting up a custom domain before launch rather than after encountering login issues?

    • ATo avoid cross-site cookie issues and ensure seamless authentication
    • BTo ensure TLS certificates are automatically provisioned
    • CTo avoid CORS configuration errors
    • DTo reduce DNS resolution time
  8. 8.What happens if you do not configure ProxyHeadersMiddleware when your app is behind a proxy?

    • AThe app will not be able to handle CORS requests
    • BThe app will not be able to establish a TLS connection
    • CThe app may generate HTTP URLs and set insecure cookies
    • DThe app will fail to load resources from the API