hi i came across the below question. i doubt more than one answer is right. can any one explain which is right option.
In which of the following situations will a session be definitely invalidated?
Select 2 correct options.
1) The container is shutdown and brought up again. 2) No request comes from the client for more than "session timeout" period. 3) A servlet explicitly calls invalidate() on a session object. 4) If the session time out is set to 0 using setMaxInactiveInterval() method, the session will never be invalidated automatically.
Shivani Chandna
Ranch Hand
Joined: Sep 18, 2004
Posts: 380
posted
0
Answer 2 &3 : 2) No request comes from the client for more than "session timeout" period. 3) A servlet explicitly calls invalidate() on a session object.
Regards, Shivani
/** Code speaks louder than words */
Firas Zuriekat
Ranch Hand
Joined: May 09, 2006
Posts: 143
posted
0
2) No request comes from the client for more than "session timeout" period
I don't understand why 2 is correct. I think for it to be correct it should be worded correctly (in terms of grammer and syntax). For it to be correct, it should be worded as follows (for e.g.):
2) No request comes from the client
You just can't talk apple and oranges. I mean you can't talk request and period. This is because request is not a form of time (period).
Please correct me if I am wrong.
Mohd Fuzail
Ranch Hand
Joined: Feb 20, 2002
Posts: 107
posted
0
2) No request comes from the client
Question is till when container will wait for request for client, before it decides to invalidate the session being create for that client.
Here 'Session Timeout' comes into picture. Container will wait till 'Session Timeout' time and if no request comes from Client till then, Session is invalidated.
Hope it helps
Being defeated is often a temporary condition. Giving up is what makes it permanent.