Last post Sep 24, 2014 10:56 AM by bruce (sqlwork.com)
Sep 23, 2014 10:56 PM|WilliamLou|LINK
I am having an issue deploying for Web Application to Load Balancer F5 model. Other load balancer is working fine.
I have configured web.config as sessionState as SQLServer, cookieless = "false". I have put the same set of machineKey for both servers via load balancer.
The problem is the session was gone and it kicked me out to login page after the user login and do some of the action. It might be because of the load balancer switching the server and the session is gone.
I am using User.Identity.IsAuthenticated as authentication.
The identity is stored as below code
Dim id As FormsIdentity = CType(User.Identity, FormsIdentity)
Dim ticket As FormsAuthenticationTicket = id.Ticket
Dim tkt As FormsAuthenticationTicket = New FormsAuthenticationTicket(1, txtUserName.Value, DateTime.Now(), _
DateTime.Now.AddMinutes(120), chkPersistCookie.Checked, userdata)
Dim cookiestr As String = FormsAuthentication.Encrypt(tkt)
Dim ck As HttpCookie = New HttpCookie(FormsAuthentication.FormsCookieName(), cookiestr)
If (chkPersistCookie.Checked) Then ck.Expires = tkt.Expiration
ck.Path = FormsAuthentication.FormsCookiePath()
I might have missed something on this.
Sep 24, 2014 10:56 AM|bruce (sqlwork.com)|LINK
check that the app names are the same for the web servers. this is used as a key to the session data. try:
select * from ASPStateTempApplications