address bugs found in codebase audit
address bugs found in codebase audit: a task in repo2rlenv-commit-runtime-v2 (Harbor dataset). Title: Session middleware panics and crashes the server when the session store fails (e.g. Redis down)
Part of FineEnvs/repo2rlenv-commit-runtime.