Vb.Net Forms Authentication Not Validating User properly
===

I have this code when to sign in User , that string sUserData is properly set.


                  Dim sUserData As String = HttpContext.Current.Request.Cookies("UserID").Value & "|" & HttpContext.Current.Request.Cookies("UserName").Value & "|" & HttpContext.Current.Request.Cookies("UserEmail").Value

                  Dim fat As FormsAuthenticationTicket = New FormsAuthenticationTicket(1, _
                     HttpContext.Current.Session("UserID"), DateTime.Now, _
                     DateTime.Now.AddDays(6), True, sUserData, _
                     FormsAuthentication.FormsCookiePath)
                  HttpContext.Current.Response.Cookies.Add(New HttpCookie(FormsAuthentication.FormsCookieName, FormsAuthentication.Encrypt(fat)))


Then I have code where I check if the user if signed in in a Shared (static) method in a Public Class like this :

             If HttpContext.Current.User.Identity.IsAuthenticated Then
             EndIf

And that works just fine , but if I put the same line in Page_load instead of a Shared Method of a class it will never go into this If statement 

              If HttpContext.Current.User.Identity.IsAuthenticated Then
              EndIf

Why is this happening , and is there some way to re-write this to work in the code-behind Page_Load instead of having to put it in a class ,The class is used in a header to allow access to certain pages - so that works fine.  But I need another way of authentication of user on Default page to change labels and buttons based on weather the user is logged in or not , and this   can not be done in a class.
