I want to update event_log table when user closes the browser.I have done this one by clicking logout button but I want this functionality when users close the browser button.
can not only generate falsified session data, which your site will trust, but also remotely execute arbitrary code, as the data is serialized using pickle.
A lot of times we have requirement to do some stuff like invalidating session whenever user clicks browser close button thereby invoking close event in browser. In Java Script we have events such as onbeforeunload and onunload.
These events as their name suggest, gets triggered whenever the page gets unload.
A MAC (Message Authentication Code) is used to protect the data against changes by the client, so that the session data will be invalidated when being tampered with.
destroys all of the data associated with the current session.