Home > Articles > Programming > Java

  • Print
  • + Share This
This chapter is from the book

Q&A

  1. Are there any drawbacks to using sessions?

  2. Yes, they put a considerable strain on the resources of the server if there are many sessions running at the same time. They can also be broken unexpectedly if the user's connection fails. All in all, in professional JSP applications, you must be prepared for cases when using a session with the user doesn't work.

  3. Can I store other data in cookies besides the cookie's name, maximum age, and value?

  4. Yes, you can also use the Cookie object's setComment and getComment methods to store a comment—a String object—in the cookie. This comment can explain the purpose of the cookie, for example.

  • + Share This
  • 🔖 Save To Your Account