set session timeout after inactivity
<p>I want to redirect back to the home page when there is no activity.
However, i dont have a user login or the need to have one. However, i want to be able to redirect back to the home page when theres no activity.</p>

<p>I set this in the web.conf</p>

<pre><code>&lt;system.web&gt;
&lt;sessionState mode="InProc"  timeout="2"&gt;
</code></pre>

<p>then, i set this in the homepage</p>

<pre><code>Session["UserId"] = 1;
</code></pre>

<p>I also tried this but the function doesnt even fire.</p>

<pre><code>protected void Page_Init(object sender, EventArgs e)
    {
        CheckSession();
    }


    private void CheckSession()
    {
        if (Session["UserId"] == null)
        {
            Response.Redirect("KioskHome.aspx");
        }
    }
</code></pre>

<p>Could i use the global.asax file?</p>

<pre><code>void Session_Start(object sender, EventArgs e)
    {
        // Code that runs when a new session is started

    }

    void Session_End(object sender, EventArgs e)
    {


    }
</code></pre>

<p>What is the simple solution? Thank you</p>
