Win a copy of Testing JavaScript Applications this week in the HTML Pages with CSS and JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Mock question regarding session

 
Ranch Hand
Posts: 485
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Ranch Hand
Posts: 380
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 144
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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.
 
Ranch Hand
Posts: 107
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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
 
Don't get me started about those stupid light bulbs.
    Bookmark Topic Watch Topic
  • New Topic