www.webdeveloper.com
Results 1 to 8 of 8

Thread: Asp session not getting stored...... Pls help !!!!!

Hybrid View

  1. #1
    Join Date
    Nov 2011
    Posts
    22

    Asp session not getting stored...... Pls help !!!!!

    we have a task tracker page (classic ASP) which is being used by associtates to track task durations. we need the page to be active throughout the day. associates use the page between intervals of 30 mins to few hours...

    the server session timeout in IIS is 20 mins and i added the below meta tag in the page which refreshes the page in 15 mins:
    [[[[<meta http-equiv="refresh" content="900">]]]]

    also on every refresh i am checking the authentication checks and resetting the key session variables again to the previous values
    e.g.
    Session("NETWORK_ID")=Session("NETWORK_ID")
    Session("NAME")=Session("NAME")
    Session("DESIGNATION_ID")=Session("DESIGNATION_ID")

    i have a default session timeout and authentication check on every page which redirects the user back to the login page.
    something like this:

    if Session("NETWORK_ID")="" or Session("NETWORK_ID")="0" or not Authenticated() then
    Response.Redirect("clear.asp") 'this page abandons sessions and returns to login

    end if


    Inspite of these many associates are losing their session and are getting logged off to the login page. what do i do so that the users don't lose their sessions???

  2. #2
    Join Date
    Jan 2008
    Location
    Florida
    Posts
    1,227
    Use cookies.

  3. #3
    Join Date
    Nov 2011
    Posts
    22
    hi yamaharuss,

    thanx for the response.... but could you please explain more on that....

    whats the difference between the two? are the cookies not supposed to get timed-out at all???

  4. #4
    Join Date
    Jan 2008
    Location
    Florida
    Posts
    1,227
    Cookies don't timeout, they expire on the date you set them to expire on. When a session expires, you can check to see if a cookie is set before loading the page. If the cookie is set you can restore all the session variables and the user would continue as if nothing changed.

  5. #5
    Join Date
    Nov 2011
    Posts
    22
    ok... got it ....

    one more question... if i am refreshing the page before the session timeout and every time resetting the session variables to their previous values, how come i am losing the session??

  6. #6
    Join Date
    Jan 2008
    Location
    Florida
    Posts
    1,227
    You would have to show your code. The only time you would read the cookie is if the session is lost.

  7. #7
    Join Date
    Nov 2011
    Posts
    22
    no.. i understand how the code has to be changed to include the cookies.

    What i am asking is in the existing code why is the session getting timed out even though i am refreshing the page every 15 sec?
    i thought refreshing the page would reset the session !!!

  8. #8
    Join Date
    Oct 2012
    Posts
    47
    First, I created a login page and added that a key value pair to the session and verify that the session on that page that holds the pair. Next, I try to go to another page that looks for the pair in the session, and there is not. I've put out for the session to 15000 so it will not timeout.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles