Revert "Fix middleware to not access session fields without user auth"

This reverts commit a62944985d12b5ed516e5fdaf97bb4083c55da41
Merge "Revert "Fix middleware to not access session fields without user auth""