Handle TokenMismatchException.

After a long time stay in login page without operating, click "login" button will lead to a whoops page causing the TokenMismatchException.