It happens when csrf token gets invalidated. If your login page remain inactive for some period of time then the token gets expired.
After refreshing your login page this issue will get resolved.
But for the permanent solution replace your login div after some interval of time with page refresh link.
Below is the example code
function hideForm () {
$('#login_form').hide();
$('#login_refresh').show();
}
$(document).ready(function () {
window.setTimeout("hideForm()", 120000);
});
Here 'login_form' is id of your login div and 'login_refresh' is id of your anchor tag with page refresh url
Above example code is for JQuery.