title: Can't i set Session in a class file?
body: <p>Why session is null in this even if i set:</p>
  
  <pre><code>public class HelperClass
  {
      public AtuhenticatedUser f_IsAuthenticated(bool _bRedirect)
      {
          HttpContext.Current.Session["yk"] = DAO.context.GetById&lt;AtuhenticatedUser&gt;(1);
          if (HttpContext.Current.Session["yk"] == null)
          {
              if (_bRedirect)
              {
                  HttpContext.Current.Response.Redirect(ConfigurationManager.AppSettings["loginPage"] + "?msg=You have to login.");
              }
  
              return null;
          }
  
          return (AtuhenticatedUser)HttpContext.Current.Session["yk"];
      }
  }
  </code></pre>
  
  <p><img src="https://content.screencast.com/users/uzay95/folders/Jing/media/f7573174-abe2-473f-82f4-78d2ac6529f6/2010-04-27_2135.png" alt="alt text"></p>