flash messages, redirect on failed login and js for automatic flash removal