in reply to Re^2: Judiciously avoiding DESTROY method for CGI::Session clobber prevention
in thread Judiciously avoiding DESTROY method for CGI::Session clobber prevention

The right answer is to make sure it always gets destroyed, not to prevent it from getting destroyed. Otherwise, you can always have changes that have not been synced.

If you really want to do things differently, you can subclass it and change the DESTROY method to not flush. You should make it check for unsaved changes and at least send a warning to the log though.

  • Comment on Re^3: Judiciously avoiding DESTROY method for CGI::Session clobber prevention