title: How to set auth role programically for tomcat 8.5
body: <p>I have the following config web.xml</p>
  <pre><code>   &lt;security-constraint&gt;
        &lt;display-name&gt;Login Security Constraint&lt;/display-name&gt;
        &lt;web-resource-collection&gt;
           &lt;web-resource-name&gt;Login Protection&lt;/web-resource-name&gt;
           &lt;url-pattern&gt;/servlet/*&lt;/url-pattern&gt;
           &lt;http-method&gt;DELETE&lt;/http-method&gt;
           &lt;http-method&gt;GET&lt;/http-method&gt;
           &lt;http-method&gt;POST&lt;/http-method&gt;
           &lt;http-method&gt;PUT&lt;/http-method&gt;
        &lt;/web-resource-collection&gt;
        &lt;auth-constraint&gt;
           &lt;role-name&gt;Login Access&lt;/role-name&gt;
        &lt;/auth-constraint&gt;
     &lt;/security-constraint&gt;
  </code></pre>
  <p>I have my own Login servlet which I have authenticated the user and created a session using</p>
  <pre><code>HttpSession session = request.getSession(true);
  </code></pre>
  <p>But how do I add the role name &quot;Login Access&quot; to the session?</p>