A JSP page is opened in a particular Session. A button is present in that JSP page onclick of which a new Window gets opened.
-
The Session is not valid in the new Window
-
The Session is valid in the new Window
-
New session is created and that is valid.
-
None of the above
When a new window is opened via JavaScript from a JSP page, session cookies are passed to the new window if it's within the same domain. This means the existing HTTP session remains valid and accessible in the new window. Option A is incorrect because sessions do persist across window opens. Option C is incorrect because a new session is not automatically created.
To answer this question, we need to understand how sessions work in web applications.
When a user accesses a JSP page, a session is created for that user. The session is used to store data that needs to be maintained across multiple requests from the same user.
In this scenario, when the button is clicked and a new window is opened, the session is still valid in the new window. This means that any session attributes or data stored in the session will still be accessible in the new window.
Therefore, the correct answer is:
Option B) The Session is valid in the new Window.