Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $.ajax('ajax.php',{timeout: 60000},function (data) {
- alert(data);
- }
- <WebMethod(CacheDuration:=0, EnableSession:=True)> _
- Public Function keepSessionAlive() As String
- If Session("UID") Is Nothing OrElse Session("UID") = 0 Then
- Throw New ApplicationException("Login")
- End If
- Session("lastKeepSessionAlive") = DateTime.Now
- If Not (Context.Request.Cookies(System.Web.Security.FormsAuthentication.FormsCookieName) Is Nothing) Then
- Dim ticket As System.Web.Security.FormsAuthenticationTicket
- Try
- ticket = System.Web.Security.FormsAuthentication.Decrypt(Context.Request.Cookies(System.Web.Security.FormsAuthentication.FormsCookieName).Value)
- If ticket.Name = Context.Session("UID") Then
- System.Web.Security.FormsAuthentication.SetAuthCookie(Context.Session("UID"), False)
- Debug.WriteLine("keepAlive:AuthenticationReset")
- End If
- Catch ex As Exception
- Debug.WriteLine("keepAlive:AuthenticationReset FAILED!!!")
- Throw New ApplicationException("Login")
- End Try
- Else
- Debug.WriteLine("keepAlive.Load: No Authentication Cookie. Error")
- Throw New ApplicationException("Login")
- End If
- Return Session.SessionID.ToString
- End Function
Add Comment
Please, Sign In to add comment