Managing Session

Discussion in 'ASP .Net' started by =?Utf-8?B?U2hhaGFyIE5lY2htYWQ=?=, Oct 18, 2006.

  1. I'm using ASP.NEt 2.0.
    I use the session to save important information about the user current
    session (for example the current project he is working on).
    I use those variables in almost every web page in the application.
    When a user session times out, I want to be able to make the user to relogin
    and continue working with the application.
    1. Is there easy way to catch an even just before the session times out? Or
    to prelong a session (so I want lose all the variables stored there?)
    2. What's the recommended way to deliver the user to the login page and than
    bring him back to where he stopped using the application?
    =?Utf-8?B?U2hhaGFyIE5lY2htYWQ=?=, Oct 18, 2006
    #1
    1. Advertising

  2. =?Utf-8?B?U2hhaGFyIE5lY2htYWQ=?=

    Hans Kesting Guest

    > I'm using ASP.NEt 2.0.
    > I use the session to save important information about the user current
    > session (for example the current project he is working on).
    > I use those variables in almost every web page in the application.
    > When a user session times out, I want to be able to make the user to relogin
    > and continue working with the application.
    > 1. Is there easy way to catch an even just before the session times out? Or
    > to prelong a session (so I want lose all the variables stored there?)
    > 2. What's the recommended way to deliver the user to the login page and than
    > bring him back to where he stopped using the application?


    You could set the session timeout to a longer period than the default
    20 minutes. Note that this will keep sessions around longer for people
    that "really left" the site, so your memory consumption goes up.

    For people that are slowly filling in a long page and hit the session
    timeout, maybe you could add an iframe that refreshes itself every 10
    minutes or so. This should keep their session alive.
    There is no server-side way to "extend a session" because you don't
    know if that user is ever coming back.

    If the user hits some page, but misses some session variables, then
    either the session was lost or he got there by typing a url.
    You could remember that url, have him log in and redirect "back".
    BUT if he needs to have some session variables from "previous pages"
    then that information is gone and you should redirect him maybe to the
    first page of the set.

    Hans Kesting
    Hans Kesting, Oct 18, 2006
    #2
    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. Jeff Smythe
    Replies:
    3
    Views:
    1,239
    Jeff Smythe
    Jan 2, 2004
  2. Simon Harvey
    Replies:
    6
    Views:
    363
    Simon Harvey
    Oct 20, 2004
  3. Vinc
    Replies:
    0
    Views:
    430
  4. Replies:
    4
    Views:
    1,836
    Roedy Green
    Jan 22, 2006
  5. gstark
    Replies:
    2
    Views:
    301
    Latish Sehgal
    Apr 6, 2007
Loading...

Share This Page