session variable preventing image retrieval
-
Hi I have been trying for ages to fill a table with images which have been returned from a database I removed my session that deals with log in status of the user, but when i removed it allowed all my images to be accessed and displayed in the table When the user is logged in the session variable is set to yes and it will timeout within 30 mins of inactivity can anyone tell me of a workaround so that i can still have this session and allow access to my images from this table? my global.asax file has the following code
<%@ Application Language="VB" %> Sub Application_Start(ByVal sender As Object, ByVal e As EventArgs) ' Code that runs on application startup End Sub Sub Application_End(ByVal sender As Object, ByVal e As EventArgs) ' Code that runs on application shutdown End Sub Sub Application_Error(ByVal sender As Object, ByVal e As EventArgs) ' Code that runs when an unhandled error occurs End Sub Sub Session_Start(ByVal sender As Object, ByVal e As EventArgs) ' Code that runs when a new session is started Session("Loggedin") = "" Session.Timeout = 30 CheckLoggedIn() End Sub ' Called when the request has been process by the Request Handler and ' HttpSessionState is available [This is the key piece of code that forces ' the user is login check with each page request] Sub Application_OnPostRequestHandlerExecute() CheckLoggedIn() End Sub 'Check that the user is logged in. Sub CheckLoggedIn() 'If the user is not logged in and you are not currently on the Login Page. If Session("LoggedIn") = "" And InStr(Request.RawUrl, "userLogin.aspx") = 0 Then Server.Transfer("relogin.aspx?ReturnUrl=adminhome.aspx") End If End Sub Sub Session_End(ByVal sender As Object, ByVal e As EventArgs) ' Code that runs when a session ends. ' Note: The Session_End event is raised only when the sessionstate mode ' is set to InProc in the Web.config file. If session mode is set to StateServer ' or SQLServer, the event is not raised. End Sub