title: getting username which is set in UserData of FormsAuthenticationTicket
body: <p>Im thinking of getting usernames of my site using this in my view(Razor syntax):</p>
  
  <pre><code>@MySite.Helpers.Utils.UserName
  </code></pre>
  
  <p>heres the utils class:</p>
  
  <pre><code>public class Utils
  {
      static FormsIdentity id = (FormsIdentity)HttpContext.Current.User.Identity;
  
      public static string UserName { get { return id.Ticket.UserData; } }
  }
  </code></pre>
  
  <p>Are there any potential problems with this code?</p>
  
  <p>The reason Im doing it like this is because Im going to store username in the userdata field of a new FormsAuthenticationTicket when the user logs in.</p>
  
  <p>I'm handling it like this because Im using facebook connect and want to store there ID in the username field in the db and their usernames/fullnames in a separate table.</p>
  
  <p>so my logic to handle facebook usernames and my site registered usernames needs to be handled differently. Upon login Im thinking of handling it there then setting userdata as the actual username.</p>
  
  <p>therefore throughout the site i can just get the logged in users name using : <code>@MySite.Helpers.Utils.UserName</code></p>
  
  <p>does this sound ok? will the fact that its a static variable be an issue?</p>
  
  <p>or is there a better way to manage this? session variables maybe?</p>
  
  <p>thanks</p>