Put Some variable in the session like logged user name for example after user loin.
In every page except login page you can check for this session value null or not. if this value is null you can re direct user to login page ( or logout page as you wanted but normally in session expiration user will direct to login page)
if you using Form authentication, set login url in your web config as below
<authentication mode="Forms">
<forms loginUrl="~/Account/Login.aspx" defaultUrl="~/Default.aspx" timeout="20">
</forms>
</authentication>