Fixes #1756 - ClassCastException in SessionExpiryFilter