Fixed core redirection logic and header contents.
Login users. Fix csrf token reset after login + logout. Clean up.
Associate plans with users.