Added error option to enable custom error handling

This error handler is only called when the session save/destroy methods are called via the middleware.

This has enabled us to log these errors with our choice of logging tool.

Hopefully this is useful. Appreciate any feedback.