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
17 days ago
Ah, session management. The bane of every developer's existence. Can I get a virtual high-five for that one?
upvoted 0 times
...
Sol
25 days ago
C and E, definitely. Although, I heard getNewSession(true) is the new hotness. Maybe I'll give that a try.
upvoted 0 times
Buffy
8 days ago
I always use C and E for creating new sessions.
upvoted 0 times
...
...
Irene
27 days 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
28 days 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
1 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
1 months ago
I'm not sure about this question. Can someone explain their rationale for choosing certain options?
upvoted 0 times
...
Caren
1 months ago
D and E seem like the obvious choices here. Why complicate things, right?
upvoted 0 times
Viola
2 days ago
A) getNewSession(true)
upvoted 0 times
...
Stephen
9 days ago
User 3: I would go with D and E as well. Keep it simple.
upvoted 0 times
...
Roselle
17 days ago
User 2: Yeah, I agree. Those options seem straightforward.
upvoted 0 times
...
Eleni
20 days ago
User 1: I think D and E are the right choices.
upvoted 0 times
...
...
Stevie
1 months ago
I believe C and D are the correct methods to create a new session.
upvoted 0 times
...
Royce
1 months ago
I think the correct answers are C and E. Gotta love those classic session methods!
upvoted 0 times
Sherita
27 days ago
Yes, those are the methods you can use to create a new session.
upvoted 0 times
...
Mireya
1 months ago
I agree, C and E are the correct answers.
upvoted 0 times
...
...
Alfreda
2 months ago
I think A and E are correct options.
upvoted 0 times
...

Save Cancel