Java EE - Interview Questions and Answers for 'Session' | Search Interview Question - javasearch.buggybread.com
Javasearch.buggybread.com

Search Interview Questions


 More than 3000 questions in repository.
 There are more than 900 unanswered questions.
Click here and help us by providing the answer.
 Have a video suggestion.
Click Correct / Improve and please let us know.
Label / Company      Label / Company / Text

   



Java EE - Interview Questions and Answers for 'Session' - 14 question(s) found - Order By Rating

 Q1. Is it safe to use session storage ?Javascript
Ans. Session storage can be accessed from XSS (Cross site Scripting) attacks but cookies (if set with "HttpOnly" and "Secure" flags) are more safer against these attacks.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     session storage  security


 Q2. Have you ever used sessionStorage ? What is the better way to store session information - sessionStorage or session cookie ?Session Management
Ans. Session Cookie, because session storage can be accessed from XSS (Cross site Scripting) attacks but cookies (if set with "HttpOnly" and "Secure" flags) are more safer against these attacks.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     SessionStorage  session cookie  session management  javascript


 Q3. What is a session bean ?Java EE
 This question was recently asked at 'BirlaSoft'.This question is still unanswered. Can you please provide an answer.


 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     session bean   java bean     Asked in 1 Companies


 Q4. What is the use of Hibernate session.evict()?Hibernate
Ans. It is used to dissociate / disconnect a particular object from the session.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     hibernate session evict  hibernate evict


 Q5. What is the use of Hibernate session.clear() ?Hibernate
Ans. It is used to clear the session and is used to dissociate disconnect all the objects from the session.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     hibernate session clear


 Q6. What is the difference between session.clear and session.evict ?Hibernate
Ans. session.clear clears all the objects from session whereas session.evict is used for evicting a particular entity.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     hibernate session clear  hibernate evict

Try 2 Question(s) Test


  Q7. What is a cookie ?Java EE
Ans. A cookie is a small piece of text stored on a user's computer by the browser for a specific domain. Commonly used for authentication, storing site preferences, and server session identification.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     cookie   javascript   web application   session management   browser   j2ee     Asked in 16 Companies      basic        frequent


 Q8. what is the use of cookie and session ? and What is the difference between them ?Java EE
Ans. Cookie and Session are used to store the user information. Cookie stores user information on client side and Session does it on server side. Primarily, Cookies and Session are used for authentication, user preferences, and carrying information across multiple requests. Session is meant for the same purpose as the cookie does. Session does it on server side and Cookie does it on client side. One more thing that quite differentiates between Cookie and Session. Cookie is used only for storing the textual information. Session can be used to store both textual information and objects.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     session   session management   java   cookies   authentication   web application   ebay      intermediate


 Q9. What is session tracking and how do you track a user session in servlets?Java EE
Ans. Session tracking is a mechanism that servlets use to maintain state about a series requests from the same user across some period of time. The methods used for session tracking are:

User Authentication - occurs when a web server restricts access to some of its resources to only those clients that log in using a recognized username and password

Hidden form fields - fields are added to an HTML form that are not displayed in the client's browser. When the form containing the fields is submitted, the fields are sent back to the server

URL rewriting - every URL that the user clicks on is dynamically modified or rewritten to include extra information. The extra information can be in the form of extra path information, added parameters or some custom, server-specific URL change.

Cookies - a bit of information that is sent by a web server to a browser and which can later be read back from that browser.

HttpSession- places a limit on the number of sessions that can exist in memory.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     j2ee   servlets   session   session management   web applications   cookies   httpsession   url rewriting   architecture     Asked in 1 Companies


 Q10. What is the use of HTTPSession in relation to http protocol ?Java EE
Ans. http protocol on its own is stateless. So it helps in identifying the relationship between multiple stateless request as they come from a single source.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     j2ee   servlets   web application   session   httpsession   architecture     Asked in 1 Companies


 Q11. Why using cookie to store session info is a better idea than just using session info in the request ?Java EE
Ans. Session info in the request can be intercepted and hence a vulnerability. Cookie can be read and write by respective domain only and make sure that right session information is being passed by the client.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     j2ee   servlets   session   session management   web applications   cookies   httpsession   architecture


 Q12. What are different types of cookies ?Java EE
Ans. Session cookies , which are deleted once the session is over.

Permanent cookies , which stays at client PC even if the session is disconnected.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     j2ee   servlets   session   session management   web applications   cookies   httpsession


 Q13. http protocol is by default ... ?Java EE
Ans. stateless

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     j2ee   servlets   session   session management   web applications   cookies   httpsession   architecture


 Q14. How many SessionFactory and Session objects are created ?Java EE
Ans. Single SessionFactory object and multiple session objects for opening different session. Hibernate creates new Session object per thread.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     hibernate   sessionfactory hibernate   session hibernate


 Q15. Which of the following session method is used to disassociate / disconnect a particular object / entity from the sessionHibernate
a. Clear
b. Evict
c. Close
d. Merge

Ans.b. Evict


Help us and Others Improve. Please let us know the questions asked in any of your previous interview.

Any input from you will be highly appreciated and It will unlock the application for 10 more requests.

Company Name:
Questions Asked: