Fix session invalidation on expiration