Why session is lost or ended when cache is cleared. While session is mentioned on server. I am java developer and I got session from HttpServletRequest object.
We manage the session on server side. Then how it is related with browser and client? Why our website is logged out when cache is cleared?
I tried it with my gmail account. When i close browser and again open gmail or when i clear cache it shows me logged out. I did google about but could not got satisfying answer. can anybody clear it?
Your Session object on server is just representation. Session information are maintained by cookies in browser by default, with cookie named
JSESSIONID. You can find out more here, see the answer from BalusC.In case when cookies are disabled on browser
JSESSIONIDmust be appended as parameter to URL. This means that in case of redirection you must call HttpServletResponse#encodeRedirectURL or usec:urltag for links in your page.