- Trending Categories
- Data Structure
- Operating System
- C Programming
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
To create a session only cookie, you need to set the expiration date of the cookie to be some years ahead. You need to set the expire attribute −
current time + 5 years
The expire attribute shows the date the cookie will expire. If this is blank, the cookie will expire when the visitor quits the browser.
Note − Do not consider removing the expire value to create a session only cookie. This won’t work. Set the expire attribute to the future date.
- What is the difference between session and cookies?
- How to read cookies with JSP?
- How to delete cookies with JSP?
- How to create a matrix with only one row in R?