Imports System.Web.SessionState
Imports DevExpress.Web

Public Class Global_asax
    Inherits System.Web.HttpApplication
        Sub Application_Start(ByVal sender As Object, ByVal e As EventArgs)
        AddHandler DevExpress.Web.ASPxWebControl.CallbackError, AddressOf Application_Error
    End Sub

    Sub Session_Start(ByVal sender As Object, ByVal e As EventArgs)
        ' Fires when the session is started
    End Sub

    Sub Application_BeginRequest(ByVal sender As Object, ByVal e As EventArgs)
        ' Fires at the beginning of each request
    End Sub

    Sub Application_AuthenticateRequest(ByVal sender As Object, ByVal e As EventArgs)
        ' Fires upon attempting to authenticate the use
    End Sub

    Sub Application_Error(ByVal sender As Object, ByVal e As EventArgs)
        ' Fires when an error occurs
    End Sub

    Sub Session_End(ByVal sender As Object, ByVal e As EventArgs)
        ' Fires when the session ends
    End Sub

    Sub Application_End(ByVal sender As Object, ByVal e As EventArgs)
        ' Fires when the application ends
    End Sub

    Private Sub Global_asax_AcquireRequestState(sender As Object, e As EventArgs) Handles Me.AcquireRequestState
        'If HttpContext.Current.Session IsNot Nothing Then
        '    Dim url = HttpContext.Current.Request.Url.AbsoluteUri
        '    Dim usu = If(HttpContext.Current.Session Is Nothing OrElse HttpContext.Current.Session("usuario") Is Nothing, "", HttpContext.Current.Session("usuario"))
        '    If (url.ToLower.EndsWith("default.aspx") = False AndAlso url.ToLower.EndsWith("sesionnovalida.aspx") = False) AndAlso usu = "" Then
        '        Server.ClearError()
        '        Response.Clear()
        '        Response.Redirect("/sesionNoValida.aspx", True)
        '    End If
        'End If
    End Sub
End Class