There are few approaches to do this.
1. Correcting your code.
if(Session["MySession"]!=null)
{
response.redirect("home.aspx");
}
Do not wrap this in the postback check as you'll be needing this for both the conditions i.e, on first load and postbacks. Think about a scenario when you are logged in to the application and are idle for few hours and then you are clicking one button in the page then you wouldn't be expecting your code to do it's stuff as session will already be expired.
2. using
Global.aspx
Check following link for further details-
Redirect Page After Session Time Out in ASP.Net[
^]
Hope, it helps :)