• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

HttpSesssionListener not called when cookies are cleared

 
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
My application uses am implementor of HttpSessionListener to remove the HttpSession instance that is stored in a map when that session is invalidated. My problem is , after logging into the application, when i manually clear the cookies in my browser, this listener class is not called . How to get my application notified when cookies are cleared in the interim. Please help
 
Sheriff
Posts: 67747
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Can't happen. How is the server going to be notified when you clear the cookies in the browser?

Besides, clearing the cookie does not invalidate the session. Rather, you've "orphaned" the session and it will eventually time out.
 
Ranch Hand
Posts: 96
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Unless I'm missing something...

Your listener doesn't fire because clearing cookies doesn't send an event to the server (and nor should it).

Think of it this way: Say I have multiple session cookies to multiple servers (say, a 1000 of them) and the browser persists those cookies even if the server tells it NOT to.

Now suppose I close all browsers and open a new browser with a blank page and I clear the cookies. Should the browser contact EVERY single server?

I think that would be a nightmare!
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic