New Year Sale 2026! Hurry Up, Grab the Special Discount - Save 25% - Ends In 00:00:00 Coupon code: SAVE25
Welcome to Pass4Success

- Free Preparation Discussions

GIAC GSNA Exam - Topic 1 Question 35 Discussion

Actual exam question for GIAC's GSNA exam
Question #: 35
Topic #: 1
[All GSNA 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:

0/2000 characters
Reena
3 months ago
getSession() is a bit ambiguous, isn't it?
upvoted 0 times
...
Blondell
3 months ago
I thought getNewSession() was the only way to go.
upvoted 0 times
...
Denise
3 months ago
Wait, can you really use getSession(false) for a new session?
upvoted 0 times
...
Phuong
4 months ago
Definitely agree with that!
upvoted 0 times
...
Dianne
4 months ago
I think getNewSession(true) and getSession(true) are the right ones.
upvoted 0 times
...
Polly
4 months ago
I have a hunch that getNewSession() is also a correct answer, but I can't recall if it requires any parameters.
upvoted 0 times
...
Paola
4 months ago
I remember practicing a question similar to this, and I think getSession() could be a default method to get a session, but not necessarily a new one.
upvoted 0 times
...
Alisha
4 months ago
I'm not entirely sure about getSession(false). I feel like it might not create a new session, but I could be wrong.
upvoted 0 times
...
Selma
5 months ago
I think getNewSession(true) might be a valid option since it sounds like it would create a new session.
upvoted 0 times
...
Shaquana
5 months ago
I feel confident about this one. The options clearly indicate the different ways to create or retrieve a session, so I'll select the appropriate methods.
upvoted 0 times
...
Carma
5 months ago
I'm a little confused by the wording of the question. I'll need to double-check my understanding of session management before answering.
upvoted 0 times
...
Eulah
5 months ago
Okay, I've got this. The key is to look for the methods that explicitly create a new session, like "getNewSession()".
upvoted 0 times
...
Dalene
5 months ago
I'm a bit unsure about this one. I'll need to think it through and make sure I understand the differences between the methods.
upvoted 0 times
...
Merilyn
5 months ago
Hmm, this seems straightforward. I'll carefully read through the options and select the ones that seem to create a new session.
upvoted 0 times
...
Phil
5 months ago
This seems straightforward enough. I'll just go through each option and evaluate the expressions based on the given code. As long as I'm careful with the function calls, I should be able to identify the two correct answers.
upvoted 0 times
...
Tamesha
5 months ago
I think the Object2Vec algorithm would be a strong choice for capturing context and differentiating between Q&A facets, but I'm not completely sure.
upvoted 0 times
...
Cassi
5 months ago
Hmm, this one seems tricky. I'll need to think carefully about the placement group options and how they relate to the requirements.
upvoted 0 times
...
Von
5 months ago
Okay, I've got an idea. With cloud computing, you pay for the resources you use rather than having to buy all the hardware upfront. That means less capital investment, right? I'm pretty confident that's the right approach for this question.
upvoted 0 times
...

Save Cancel