0
0
Cybersecurityknowledge~10 mins

Secure session management in Cybersecurity - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to set a secure session cookie.

Cybersecurity
Set-Cookie: sessionId=abc123; [1]
Drag options to blanks, or click blank then click option'
AHttpOnly
BPath=/
CMax-Age=3600
DDomain=example.com
Attempts:
3 left
💡 Hint
Common Mistakes
Using Max-Age instead of HttpOnly for security
Forgetting to set HttpOnly attribute
2fill in blank
medium

Complete the code to ensure the session cookie is only sent over HTTPS.

Cybersecurity
Set-Cookie: sessionId=abc123; [1]
Drag options to blanks, or click blank then click option'
AHttpOnly
BPath=/
CSameSite=Strict
DSecure
Attempts:
3 left
💡 Hint
Common Mistakes
Confusing Secure with HttpOnly
Not setting Secure attribute on sensitive cookies
3fill in blank
hard

Fix the error in the session cookie attribute to prevent cross-site request forgery.

Cybersecurity
Set-Cookie: sessionId=abc123; HttpOnly; [1]
Drag options to blanks, or click blank then click option'
ASameSite=Lax
BSameSite=Strict
CSameSite=None
DSecure
Attempts:
3 left
💡 Hint
Common Mistakes
Using SameSite=None without Secure attribute
Not setting SameSite attribute at all
4fill in blank
hard

Fill both blanks to create a secure session cookie that expires after one hour and is restricted to the root path.

Cybersecurity
Set-Cookie: sessionId=abc123; [1]; [2]
Drag options to blanks, or click blank then click option'
AMax-Age=3600
BHttpOnly
CPath=/
DSecure
Attempts:
3 left
💡 Hint
Common Mistakes
Confusing Max-Age with Expires attribute
Setting Path to a subdirectory instead of root
5fill in blank
hard

Fill all three blanks to define a secure session cookie that is HttpOnly, Secure, and uses strict same-site policy.

Cybersecurity
Set-Cookie: sessionId=abc123; [1]; [2]; [3]
Drag options to blanks, or click blank then click option'
AHttpOnly
BSecure
CSameSite=Strict
DPath=/
Attempts:
3 left
💡 Hint
Common Mistakes
Omitting one or more security attributes
Using SameSite=None without Secure