for redirect, use 307 (temporary) rather than 301 (permanent)

when a session expires, I get redirected to the login page, but I can't get back to the page I want unless I clear browser cache.