2
similarities between coookies and session 1. both of them are session tracking techniques 2. both of them impletment key-value pair 3. both uses String as its key 4. both of them are containers differences between cookies and session 1. cookie uses string as value while session uses object 2. cookie persists on the client while HttpSession is contained on the server 3. cookie is prone to privacy vulerability while HttpSession object is not(resid es on the server) 4. cookie is limited to 20 cookies per site while session exists one per user 5. cookies persists a lot longer than session Three Types of session termination 1. instant timeout - using invalidate() 2. programmatic session timeout - using setMaxInactiveInterval() 3. declarative session timeout - using web.xml

Similarities and Differences of Cookies and Session

Embed Size (px)

Citation preview

Page 1: Similarities and Differences of Cookies and Session

7/23/2019 Similarities and Differences of Cookies and Session

http://slidepdf.com/reader/full/similarities-and-differences-of-cookies-and-session 1/1

similarities between coookies and session1. both of them are session tracking techniques2. both of them impletment key-value pair3. both uses String as its key4. both of them are containers

differences between cookies and session1. cookie uses string as value while session uses object2. cookie persists on the client while HttpSession is contained on the server3. cookie is prone to privacy vulerability while HttpSession object is not(resides on the server)4. cookie is limited to 20 cookies per site while session exists one per user5. cookies persists a lot longer than session

Three Types of session termination1. instant timeout - using invalidate()2. programmatic session timeout - using setMaxInactiveInterval()3. declarative session timeout - using web.xml