var sessionTimeout = 30 * 60; //30 minutes
function toLoginPage() {
window.location = '/login';
}
setTimeout(toLoginPage, sessionTimeout);
или
var sessionTimeout = 30 * 60; //30 minutes
setTimeout(function () {
window.location = '/login';
}, sessionTimeout);