Session Expired

K

Kenny

Hi,

Is there anyone know how to detect and redirect the page when hit the error
message as below:-

Thanks,
Kenny

Server Error in '/MobileMM' Application.
----------------------------------------------------------------------------
----

The page requires session state that is no longer available. Either the
session has expired, the client did not send a valid session cookie, or the
session state history size is too small. Try increasing the history size or
session expiry limit.

Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information
about the error and where it originated in the code.

Exception Details: System.Exception: The page requires session state that is
no longer available. Either the session has expired, the client did not send
a valid session cookie, or the session state history size is too small. Try
increasing the history size or session expiry limit.

Source Error:

An unhandled exception was generated during the execution of the current web
request. Information regarding the origin and location of the exception can
be identified using the exception stack trace below.

Stack Trace:

[Exception: The page requires session state that is no longer available.
Either the session has expired, the client did not send a valid session
cookie, or the session state history size is too small. Try increasing the
history size or session expiry limit.]
System.Web.UI.MobileControls.MobilePage.OnViewStateExpire(EventArgs e) +45
System.Web.UI.MobileControls.MobilePage.LoadPageStateFromPersistenceMedium()
+315
System.Web.UI.Page.LoadPageViewState() +18
System.Web.UI.Page.ProcessRequestMain() +423
 
S

steph

In vb:

Protected Overrides Sub OnViewStateExpire(ByVal e As
EventArgs)
'viewstate has expired
Me.RedirectToMobilePage("errorEvent.aspx?ref=viewstate")
End Sub
 
S

steph

In vb:

Protected Overrides Sub OnViewStateExpire(ByVal e As
EventArgs)
'viewstate has expired
Me.RedirectToMobilePage("errorEvent.aspx?ref=viewstate")
End Sub
 
S

steph

In vb:

Protected Overrides Sub OnViewStateExpire(ByVal e As
EventArgs)
'viewstate has expired
Me.RedirectToMobilePage("errorEvent.aspx?ref=viewstate")
End Sub
 
K

Kenny

Hi Steph,

Now I am able to redirect the main page to the login page when session
expired with OnViewStateExpire. What if a user click the login button after
few minits and hit the session timeout again?

I just wonder why the new session is not created only when the user click
the login button?

I though by adding this


steph said:
In vb:

Protected Overrides Sub OnViewStateExpire(ByVal e As
EventArgs)
'viewstate has expired
Me.RedirectToMobilePage("errorEvent.aspx?ref=viewstate")
End Sub

-----Original Message-----
Hi,

Is there anyone know how to detect and redirect the page when hit the error
message as below:-

Thanks,
Kenny

Server Error in '/MobileMM' Application.
---------------------------------------------------------- ------------------
----

The page requires session state that is no longer available. Either the
session has expired, the client did not send a valid session cookie, or the
session state history size is too small. Try increasing the history size or
session expiry limit.

Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information
about the error and where it originated in the code.

Exception Details: System.Exception: The page requires session state that is
no longer available. Either the session has expired, the client did not send
a valid session cookie, or the session state history size is too small. Try
increasing the history size or session expiry limit.

Source Error:

An unhandled exception was generated during the execution of the current web
request. Information regarding the origin and location of the exception can
be identified using the exception stack trace below.

Stack Trace:

[Exception: The page requires session state that is no longer available.
Either the session has expired, the client did not send a valid session
cookie, or the session state history size is too small. Try increasing the
history size or session expiry limit.]
System.Web.UI.MobileControls.MobilePage.OnViewStateExpire (EventArgs e) +45
System.Web.UI.MobileControls.MobilePage.LoadPageStateFromP ersistenceMedium()
+315
System.Web.UI.Page.LoadPageViewState() +18
System.Web.UI.Page.ProcessRequestMain() +423

---------------------------------------------------------- ------------------
----
Version Information: Microsoft .NET Framework Version:1.1.4322.573; ASP.NET
Version:1.1.4322.573


.
 
K

Kenny

Hi Steph,

Now I am able to redirect the main page to the login page when session
expired with OnViewStateExpire. What to do if a user click the login button
(*after 1 min) and hit the session timeout again?

I just wonder why the new session is not created only when the user click
the login button? and How?

I though by adding Session.Abondon can solve the problem but it seems like
when I click the Login button (* after 1 min), the program still calling the
OnViewStateExpire and give me timeout message.

Protected Overrides Sub OnViewStateExpire(ByVal e As EventArgs)
Session.Abondon()
RedirectToMobilePage("MobileLogin.aspx?err=timeout")
End Sub

Currently I set the SessionTimeout to 1 for testing purpose.

tx,
Kenny


steph said:
In vb:

Protected Overrides Sub OnViewStateExpire(ByVal e As
EventArgs)
'viewstate has expired
Me.RedirectToMobilePage("errorEvent.aspx?ref=viewstate")
End Sub

-----Original Message-----
Hi,

Is there anyone know how to detect and redirect the page when hit the error
message as below:-

Thanks,
Kenny

Server Error in '/MobileMM' Application.
---------------------------------------------------------- ------------------
----

The page requires session state that is no longer available. Either the
session has expired, the client did not send a valid session cookie, or the
session state history size is too small. Try increasing the history size or
session expiry limit.

Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information
about the error and where it originated in the code.

Exception Details: System.Exception: The page requires session state that is
no longer available. Either the session has expired, the client did not send
a valid session cookie, or the session state history size is too small. Try
increasing the history size or session expiry limit.

Source Error:

An unhandled exception was generated during the execution of the current web
request. Information regarding the origin and location of the exception can
be identified using the exception stack trace below.

Stack Trace:

[Exception: The page requires session state that is no longer available.
Either the session has expired, the client did not send a valid session
cookie, or the session state history size is too small. Try increasing the
history size or session expiry limit.]
System.Web.UI.MobileControls.MobilePage.OnViewStateExpire (EventArgs e) +45
System.Web.UI.MobileControls.MobilePage.LoadPageStateFromP ersistenceMedium()
+315
System.Web.UI.Page.LoadPageViewState() +18
System.Web.UI.Page.ProcessRequestMain() +423

---------------------------------------------------------- ------------------
----
Version Information: Microsoft .NET Framework Version:1.1.4322.573; ASP.NET
Version:1.1.4322.573


.
 
C

Cheryl

To catch a page error you can always use this:

Private Sub Page_Error(ByVal sender As Object, ByVal e As
System.EventArgs) Handles MyBase.Error
' Add some code here to log error if desired
Server.Transfer("CustomErrorPage.aspx")
End Sub

This will handle any errors in your page and redirect to an error
page. Before redirecting you could log the errors somewhere if you
want to see what it is but that way the user gets a nice friendly
page.







Kenny said:
Hi Steph,

Now I am able to redirect the main page to the login page when session
expired with OnViewStateExpire. What to do if a user click the login button
(*after 1 min) and hit the session timeout again?

I just wonder why the new session is not created only when the user click
the login button? and How?

I though by adding Session.Abondon can solve the problem but it seems like
when I click the Login button (* after 1 min), the program still calling the
OnViewStateExpire and give me timeout message.

Protected Overrides Sub OnViewStateExpire(ByVal e As EventArgs)
Session.Abondon()
RedirectToMobilePage("MobileLogin.aspx?err=timeout")
End Sub

Currently I set the SessionTimeout to 1 for testing purpose.

tx,
Kenny


steph said:
In vb:

Protected Overrides Sub OnViewStateExpire(ByVal e As
EventArgs)
'viewstate has expired
Me.RedirectToMobilePage("errorEvent.aspx?ref=viewstate")
End Sub

-----Original Message-----
Hi,

Is there anyone know how to detect and redirect the page when hit the error
message as below:-

Thanks,
Kenny

Server Error in '/MobileMM' Application.
---------------------------------------------------------- ------------------
----

The page requires session state that is no longer available. Either the
session has expired, the client did not send a valid session cookie, or the
session state history size is too small. Try increasing the history size or
session expiry limit.

Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information
about the error and where it originated in the code.

Exception Details: System.Exception: The page requires session state that is
no longer available. Either the session has expired, the client did not send
a valid session cookie, or the session state history size is too small. Try
increasing the history size or session expiry limit.

Source Error:

An unhandled exception was generated during the execution of the current web
request. Information regarding the origin and location of the exception can
be identified using the exception stack trace below.

Stack Trace:

[Exception: The page requires session state that is no longer available.
Either the session has expired, the client did not send a valid session
cookie, or the session state history size is too small. Try increasing the
history size or session expiry limit.]
System.Web.UI.MobileControls.MobilePage.OnViewStateExpire (EventArgs e) +45
System.Web.UI.MobileControls.MobilePage.LoadPageStateFromP ersistenceMedium()
+315
System.Web.UI.Page.LoadPageViewState() +18
System.Web.UI.Page.ProcessRequestMain() +423

---------------------------------------------------------- ------------------
----
Version Information: Microsoft .NET Framework Version:1.1.4322.573; ASP.NET
Version:1.1.4322.573


.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,056
Latest member
GlycogenSupporthealth

Latest Threads

Top