Question 117 of 504
Cloud Application SecurityeasyMultiple ChoiceObjective-mapped

Quick Answer

The most secure mechanism for session token storage in a browser-based web application is HTTP-only cookies with Secure and SameSite flags. This combination is superior because the HTTP-only flag prevents any client-side script from accessing the token, effectively neutralizing XSS-based token theft, while the Secure flag ensures the cookie is only transmitted over HTTPS, blocking network eavesdropping. The SameSite flag further restricts cross-origin requests, mitigating CSRF attacks. On the Certified Cloud Security Professional CCSP exam, this concept tests your understanding of secure session management under the Domain 2: Cloud Data Security, often appearing as a scenario where a developer must choose between localStorage, sessionStorage, or cookies. A common trap is assuming JavaScript-accessible storage is safe if the app uses HTTPS, but the CCSP emphasizes defense-in-depth. Remember the mnemonic “HSS”: HTTP-only, Secure, SameSite—the three flags that lock down a session token from script, sniffing, and cross-site forgery.

CCSP Cloud Application Security Practice Question

This CCSP practice question tests your understanding of cloud application security. Read the scenario carefully and evaluate each option against the stated constraints before committing to an answer. After answering, compare your reasoning against the explanation and wrong-answer breakdown below. Once you have made your selection, read the full explanation to reinforce the concept and understand why each distractor is designed to mislead on exam day.

A developer is tasked with securely storing a session token in a browser-based web application. Which storage mechanism is most secure?

Question 1easymultiple choice
Full question →

Answer choices

Why each option matters

Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.

Correct answer & explanation

HTTP-only cookies with Secure and SameSite flags

HTTP-only cookies with Secure and SameSite flags are the most secure storage mechanism for session tokens because they prevent client-side script access (mitigating XSS-based token theft), ensure transmission only over HTTPS (mitigating network eavesdropping), and restrict cross-origin request inclusion (mitigating CSRF). This combination aligns with OWASP best practices for session management, as the token is never exposed to JavaScript or sent over unencrypted channels.

Key principle: Answer the scenario, not the keyword: identify the specific constraint before choosing the most familiar-sounding option.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • HTTP-only cookies with Secure and SameSite flags

    Why this is correct

    HTTP-only cookies are not accessible via JavaScript and Secure flag ensures HTTPS.

    Related concept

    Read the scenario before looking for a memorised answer.

  • sessionStorage

    Why it's wrong here

    sessionStorage is also accessible by JavaScript.

  • URL query parameters

    Why it's wrong here

    Query strings are logged and exposed.

  • localStorage

    Why it's wrong here

    localStorage is accessible by JavaScript, vulnerable to XSS.

Common exam traps

Common exam trap: answer the scenario, not the keyword

ISC2 often tests the misconception that localStorage or sessionStorage is secure because they are 'client-side only,' but the trap is that both are fully accessible via JavaScript and thus vulnerable to XSS, whereas HTTP-only cookies are the only option that prevents script-level access.

Detailed technical explanation

How to think about this question

HTTP-only cookies leverage the Set-Cookie header with the HttpOnly flag (RFC 6265) to prevent document.cookie access, while the Secure flag enforces TLS-only transmission (RFC 6265 §4.1.2.5). The SameSite attribute (SameSite=Lax or Strict) mitigates CSRF by controlling cookie attachment to cross-site requests; for session tokens, SameSite=Strict is recommended to block all cross-site usage, though Lax is often used for usability. In a real-world scenario, even with HTTPS, a missing SameSite flag allows CSRF via a cross-origin form submission, while missing HttpOnly exposes the token to a stored XSS payload in a comment field.

KKey Concepts to Remember

  • Read the scenario before looking for a memorised answer.
  • Find the constraint that changes the correct option.
  • Eliminate answers that are true in general but not in this case.

TExam Day Tips

  • Watch for words such as best, first, most likely and least administrative effort.
  • Review why wrong options are wrong, not only why the correct option is correct.

Key takeaway

Answer the scenario, not the keyword: identify the specific constraint before choosing the most familiar-sounding option.

Real-world example

How this comes up in practice

A security analyst at a medium-sized enterprise encounters this scenario during an investigation or architecture review. The correct answer reflects best practice for the specific threat or control described. Answer the scenario, not the keyword: identify the specific constraint before choosing the most familiar-sounding option. Security exam questions test whether you can match controls to threats in context — not just recall definitions.

What to study next

Got this wrong? Here's your next step.

Identify which exam domain this question belongs to, review the core concept, then practise similar questions from the same domain.

Related practice questions

Related CCSP practice-question pages

Use these pages to review the topic behind this question. This is how one missed question becomes focused revision.

Practice this exam

Start a free CCSP practice session

Short sessions build daily habit. Longer sessions build exam-day stamina. Try a timed session to simulate real conditions.

FAQ

Questions learners often ask

What does this CCSP question test?

Cloud Application Security — This question tests Cloud Application Security — Read the scenario before looking for a memorised answer..

What is the correct answer to this question?

The correct answer is: HTTP-only cookies with Secure and SameSite flags — HTTP-only cookies with Secure and SameSite flags are the most secure storage mechanism for session tokens because they prevent client-side script access (mitigating XSS-based token theft), ensure transmission only over HTTPS (mitigating network eavesdropping), and restrict cross-origin request inclusion (mitigating CSRF). This combination aligns with OWASP best practices for session management, as the token is never exposed to JavaScript or sent over unencrypted channels.

What should I do if I get this CCSP question wrong?

Identify which exam domain this question belongs to, review the core concept, then practise similar questions from the same domain.

What is the key concept behind this question?

Read the scenario before looking for a memorised answer.

About these practice questions

Courseiva creates original exam-style practice questions with explanations and wrong-answer analysis. It does not publish real exam questions, exam dumps, or protected exam content. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

Keep practising

More CCSP practice questions

Last reviewed: Jun 30, 2026

Question Discussion

Share a tip, memory trick, or ask about the reasoning behind this question. Do not post real exam questions, leaked content, braindumps, or copyrighted exam material. Comments are moderated and may be removed without notice.

Loading comments…

Sign in to join the discussion.

This CCSP practice question is part of Courseiva's free ISC2 certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the CCSP exam.