Session Expired

Discussion in 'ASP .Net Mobile' started by Kenny, Oct 23, 2003.

  1. Kenny

    Kenny Guest

    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

    ----------------------------------------------------------------------------
    ----
    Version Information: Microsoft .NET Framework Version:1.1.4322.573; ASP.NET
    Version:1.1.4322.573
     
    Kenny, Oct 23, 2003
    #1
    1. Advertising

  2. Kenny

    steph Guest

    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
    >
    >
    >.
    >
     
    steph, Oct 23, 2003
    #2
    1. Advertising

  3. Kenny

    steph Guest

    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
    >
    >
    >.
    >
     
    steph, Oct 23, 2003
    #3
  4. Kenny

    steph Guest

    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
    >
    >
    >.
    >
     
    steph, Oct 23, 2003
    #4
  5. Kenny

    Kenny Guest

    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" <> wrote in message
    news:090d01c39957$0db6bcb0$...
    > 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
    > >
    > >
    > >.
    > >
     
    Kenny, Oct 29, 2003
    #5
  6. Kenny

    Kenny Guest

    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" <> wrote in message
    news:090d01c39957$0db6bcb0$...
    > 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
    > >
    > >
    > >.
    > >
     
    Kenny, Oct 29, 2003
    #6
  7. Kenny

    Cheryl Guest

    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" <> wrote in message news:<>...
    > 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" <> wrote in message
    > news:090d01c39957$0db6bcb0$...
    > > 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
    > > >
    > > >
    > > >.
    > > >
     
    Cheryl, Oct 29, 2003
    #7
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    0
    Views:
    486
  2. TSelvan
    Replies:
    1
    Views:
    1,781
    Natty Gur
    Jul 30, 2003
  3. Lenny

    Session Expired error

    Lenny, Jul 31, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    448
    Alvin Bruney
    Jul 31, 2003
  4. Replies:
    2
    Views:
    237
  5. Replies:
    0
    Views:
    176
Loading...

Share This Page