I resolved this by adding Global.asax file to the project and added this response.redirect code, as shown below,
void Session_Start(object sender, EventArgs e)
{
// Code that runs when a new session is started
Response.Redirect("Default.aspx");
}
After this, when the Session expires, it will redirect to the page which is set.