Cookie login flag

Whenever a user logs in with cookie data we should consider the scenario where someone else accesed his computer and found him loged in. In that case we request a re-enter of the password when performing sesitive actions.
To achive this I added a sesion flag $_SESSION['logged_in_with_cookie']=1; that should be checked whenever that kind of sensitive requests are made.