Please view the ASP.NET page life cycle. The session has been started before the login page is processed. Seems logical right? How could you access a Session variable without the session having been started already?
Redirect the user after they have successfully logged in.
Also, this check should be made much earlier. Why go through the database call if the user is already logged in?
if(Session["logged"] != null)
Most importantly, you would be much better off using the built-in ASP.NET login controls and functionality. The session state and redirects would be handled automatically as configured in the web.config file.