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 GSNA Exam - Topic 1 Question 35 Discussion

Posted by Leota on Oct 20, 2023 at 04:13 PM

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.

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.


Get Premium GSNA Questions as Interactive Web-Based Practice Test or PDF Real Exam Format Detailed Explanations Instant Access Get Your Practice Test
18 comments · newest first
RE
Reena 10 months ago
getSession() is a bit ambiguous, isn't it?
BL
Blondell 11 months ago
I thought getNewSession() was the only way to go.
DE
Denise 11 months ago
Wait, can you really use getSession(false) for a new session?
PH
Phuong 11 months ago
Definitely agree with that!
DI
Dianne 11 months ago
I think getNewSession(true) and getSession(true) are the right ones.
PO
Polly 11 months ago
I have a hunch that getNewSession() is also a correct answer, but I can't recall if it requires any parameters.
PA
Paola 12 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.
AL
Alisha 12 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.
SE
Selma 12 months ago
I think getNewSession(true) might be a valid option since it sounds like it would create a new session.
SH
Shaquana 1 year 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.
CA
Carma 1 year 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.
EU
Eulah 1 year ago
Okay, I've got this. The key is to look for the methods that explicitly create a new session, like "getNewSession()".
DA
Dalene 1 year 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.
ME
Merilyn 1 year ago
Hmm, this seems straightforward. I'll carefully read through the options and select the ones that seem to create a new session.
PH
Phil 1 year 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.
TA
Tamesha 1 year 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.
CA
Cassi 1 year ago
Hmm, this one seems tricky. I'll need to think carefully about the placement group options and how they relate to the requirements.
VO
Von 1 year 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.
0/2000 characters

Save Cancel