title: Fetching session attributes from static methods
body: <p>I have used below codes for fetching session attributes from session util class(contains static methods). Want to know that below code could be right approach in multithreaded environment or is there any better other ways for fetching sessions from util.</p>
  
  <pre><code>public static HttpSession getSession(){
      ServletRequestAttributes attr = (ServletRequestAttributes) RequestContextHolder.currentRequestAttributes();
      HttpSession session = attr.getRequest().getSession();
      return session;
  }
  public static String getEmailIDFromSession(){
      return (String)getSession().getAttribute("USER_EMAIL");
  }
  </code></pre>