catch cookies as disabled error

Hello,

I have a following problem to solve:

  1. User starts editing form - lock is created in the database.
  2. User clears cookies in web browser - vaddin shows “cookies are disabled” error and reloads application.

Result:
Lock still exists in database.

I have successfully deleted lock from database on session timeout error, simply by overriding “close” method in Application. But in case “cookies disabled” error application does not invoke close method. I have checked setLogoutUrl and teminalError but none of those got fired. How should I solve this? Thanks in advance.

If a user disables his/her cookies, then it’s just like shutting down the browser – that user disappears. Hitting the site again with cookies off or cleared won’t connect that browser to the previous session, so you just have to wait for something to time out. Instead of doing this in Vaadin, you can also add a
session listener
to the application and catch the session expiration directly. (You could also programmatically set the session timeout to be smaller once the user starts editing if you’d like.) Let me know if you’d like more info about session listeners, but I may have already given some examples in the forums.

The only alternative I can think of is some sort of other timer that releases the db lock if there hasn’t been any activity for a while.

Cheers,
Bobby

Another option might be to use
optimistic locking
instead.

Thanks for answers, I’ll try your ideas.

Best regards,
Tomek