• +91 9723535972
  • info@interviewmaterial.com

JSP Interview Questions and Answers

Question - How are cookies set in JSP?

Answer -

Setting cookies with JSP involves the following steps:

  • Creating a Cookie object: Cookie constructor is called with a cookie name and a cookie value, both are strings.
  • Setting the maximum age: setMaxAge is used to specify the length of the cookie(in seconds) should be valid.
  • Sending the cookie into the HTTP response headers: response.addCookie is used to add cookies in the HTTP response header.

Comment(S)

Show all Coment

Leave a Comment




NCERT Solutions

 

Share your email for latest updates

Name:
Email:

Our partners