Deal of The Day! Hurry Up, Grab the Special Discount - Save 25% - Ends In 00:00:00 Coupon code: SAVE25
Welcome to Pass4Success

- Free Preparation Discussions

GIAC Exam GSNA Topic 1 Question 52 Discussion

Actual exam question for GIAC's GIAC Systems and Network Auditor exam
Question #: 52
Topic #: 1
[All GIAC Systems and Network Auditor Questions]

You work as a Software Developer for UcTech Inc. You want to create a new session. Which of the following methods can you use to accomplish the task?

Each correct answer represents a complete solution. Choose all that apply.

Show Suggested Answer Hide Answer
Suggested Answer: C, D

The getSession() method of the HttpServletRequest interface returns the current session associated with the request, or creates a new

session if no session exists. The method has two syntaxes as follows:

public HttpSession getSession(): This method creates a new session if it does not exist.

public HttpSession getSession(boolean create): This method becomes similar to the above method if create is true, and returns the

current session if create is false. It returns null if no session exists.

Answer B is incorrect. The getSession(false) method returns a pre-existing session. It returns null if the

client has no session

associated with it.

Answer A and E are incorrect. There is no such method as getNewSession() in Java.


Contribute your Thoughts:

Afton
2 months ago
Ah, session management. The bane of every developer's existence. Can I get a virtual high-five for that one?
upvoted 0 times
Ronny
27 days ago
D) getSession(true)
upvoted 0 times
...
Karol
28 days ago
C) getSession()
upvoted 0 times
...
Mozelle
1 months ago
E) getNewSession()
upvoted 0 times
...
Lisandra
1 months ago
A) getNewSession(true)
upvoted 0 times
...
...
Sol
2 months ago
C and E, definitely. Although, I heard getNewSession(true) is the new hotness. Maybe I'll give that a try.
upvoted 0 times
Mireya
1 months ago
I haven't tried getNewSession(true) yet, but I'll give it a shot.
upvoted 0 times
...
Nakita
1 months ago
I think C and E are the most reliable methods for creating sessions.
upvoted 0 times
...
William
1 months ago
I prefer using getNewSession(true) for creating sessions.
upvoted 0 times
...
Buffy
2 months ago
I always use C and E for creating new sessions.
upvoted 0 times
...
...
Irene
2 months ago
I agree with Wei. 'getSession' without any parameters might just retriIrene an existing session, so A and E seem like the right choices for creating a new session.
upvoted 0 times
...
Wei
2 months ago
I think A and E are correct because 'getNewSession' implies creating a new session, and having 'true' as a parameter might indicate some specific settings for the session.
upvoted 0 times
...
Jamey
2 months ago
Hmm, I'm gonna go with B and D. Might as well cover all the bases, just in case.
upvoted 0 times
...
Jennifer
2 months ago
I'm not sure about this question. Can someone explain their rationale for choosing certain options?
upvoted 0 times
...
Caren
2 months ago
D and E seem like the obvious choices here. Why complicate things, right?
upvoted 0 times
Estrella
18 days ago
Definitely, keeping it simple with D and E is the way to go.
upvoted 0 times
...
Dawne
19 days ago
I agree, D and E are the best options.
upvoted 0 times
...
Vincenza
20 days ago
E) getNewSession()
upvoted 0 times
...
Shelba
21 days ago
D) getSession(true)
upvoted 0 times
...
Felice
22 days ago
C) getSession()
upvoted 0 times
...
Vernice
1 months ago
B) getSession(false)
upvoted 0 times
...
Viola
1 months ago
A) getNewSession(true)
upvoted 0 times
...
Stephen
2 months ago
User 3: I would go with D and E as well. Keep it simple.
upvoted 0 times
...
Roselle
2 months ago
User 2: Yeah, I agree. Those options seem straightforward.
upvoted 0 times
...
Eleni
2 months ago
User 1: I think D and E are the right choices.
upvoted 0 times
...
...
Stevie
3 months ago
I believe C and D are the correct methods to create a new session.
upvoted 0 times
...
Royce
3 months ago
I think the correct answers are C and E. Gotta love those classic session methods!
upvoted 0 times
Sherita
2 months ago
Yes, those are the methods you can use to create a new session.
upvoted 0 times
...
Mireya
2 months ago
I agree, C and E are the correct answers.
upvoted 0 times
...
...
Alfreda
3 months ago
I think A and E are correct options.
upvoted 0 times
...

Save Cancel
az-700  pass4success  az-104  200-301  200-201  cissp  350-401  350-201  350-501  350-601  350-801  350-901  az-720  az-305  pl-300  

Warning: Cannot modify header information - headers already sent by (output started at /pass.php:70) in /pass.php on line 77