title: passing value from one form to another using code behind files in C#
body: <p>I am trying to check to see if the value of <code>UserAuthInfo.Current</code> is set when redirecting from the <code>default.aspx</code> page to the <code>profile.aspx</code> page. Below is the code I have on both pages:</p>
  
  <p>DEFAULT.ASPX code snippet</p>
  
  <pre><code>if ((logonHolder.AccountStatus))
  {
  
    UserAuthInfo authInfo = new UserAuthInfo();
    authInfo.UserID = logonHolder.UserID.ToString();
    //strlogon_ID
    authInfo.IsAuthenticated = true;                                
    authInfo.Attributes.Add("logon_ID", logonHolder.UserID);
    authInfo.Attributes.Add("Email", txtEmail.Text);
    authInfo.Attributes.Add("UserType", logonHolder.UserType);
     if (logonHolder.UserType == "A")
     {
       authInfo.Attributes.Add("IsAdmin", "Y");
     }
     else
     {
       authInfo.Attributes.Add("IsAdmin", "N");
     }
     authInfo.Roles.Add(logonHolder.UserType);
     authInfo.Attributes.Add("LastName", logonHolder.LastName);
     authInfo.Attributes.Add("FirstName", logonHolder.FirstName);
     authInfo.Attributes.Add("user_employee_number", logonHolder.EmployeeID);
     authInfo.Attributes.Add("user_id", logonHolder.UserID);
     authInfo.Attributes.Add("SessionGUID", _holderService.CreateSession(strret_code, logonHolder.UserID));
  
     authInfo.CreateTicket(); 
     Session["Session"] = "Valid";
     authInfo.Attributes.Add("user_login_security", LoginSecurity.Unrestricted);
  
  **if (UserAuthInfo.Current != null &amp;&amp; UserAuthInfo.Current.IsAuthenticated)
    {
      Response.Redirect("profile.aspx", false);
    }**
  </code></pre>
  
  <p>Profile.aspx Page_Load code snippet</p>
  
  <pre><code>if (UserAuthInfo.Current == null || !HttpContext.Current.User.Identity.IsAuthenticated)
  {
    Response.Redirect(FormsAuthentication.LoginUrl, true);
    return;
  }
  </code></pre>
  
  <p>When running the code, the value of UserAuthInfo.Current is set on the default.aspx page, but it is always null on the profile.aspx page.</p>