Tomcat 8 creates a new session on startup
<p>I just noticed today that every time Tomcat(8) starts up, it creates a new <code>HttpSession</code> (without any <code>HttpServletRequest</code>).</p>

<p>I just added a SessionListener like this:</p>

<pre><code>public class SessionListener implements HttpSessionListener {
    public SessionListener() {}

    public void sessionCreated(HttpSessionEvent sessionEvent) {
        HttpSession session = sessionEvent.getSession();
        ServletContext context = session.getServletContext();

        try {
            if(session.isNew()){
                System.out.println("a new Session is created");
            }
        } catch (Exception e) {}
    }

    public void sessionDestroyed(HttpSessionEvent sessionEvent) {}
}
</code></pre>

<p>The only thing I changed today is this in the <code>context.xml</code>:</p>

<pre><code>&lt;Context&gt;
    &lt;Resource name="jdbc/test"
              auth="Container"
              type="javax.sql.DataSource"
              factory="org.apache.tomcat.jdbc.pool.DataSourceFactory"           
              maxActive="-1"
              minIdle="-1"
              maxWait="10000"
              initialSize="10"
              username="XYZ" 
              password="XYZ" 
              driverClassName="com.mysql.jdbc.Driver"
              url="jdbc:mysql://localhost:3306/test"/&gt;
&lt;/Context&gt;
</code></pre>

<p>But the last couldn't be the cause of creation of a session on container startup, right?</p>