#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2003
    Posts
    7
    Rep Power
    0

    Unhappy Maintaining Session State


    I am developing an intranet application for our office network using asp, SQL server and IIS.

    Version 1 of the application is has worked absolutely fine up to now.

    This morning, I "installed" version 2 onto the server and all works well apart from one really annoying thing...

    Session variables are not maintained across pages.

    E.g.

    The login page creates two session variables, empID and Admin using the following asp code:

    session.contents("empID")=cmd.parameters("EmpID").value
    session.contents("Admin")=cmd.parameters("Admin").value

    ...then it redirects to another page as follows:

    response.redirect("jobs.asp?stat=browse&type=my")

    ...jobs.asp cannot then find the session variables.

    I have performed a few error-checking tests and found out that between any two pages, the sessionID is not the same. Therefore, i am under the impression that the server is not maintaining session state.

    IIS is configured to enable session state with the timeout at a default 20mins.

    Anyone got a clue what is going on? I am baffled, as i have used session variables in version 1 with no problems at all and no configuration has changed since then.

    Cheers,

    Chris
  2. #2
  3. No Profile Picture
    Grumpier old Moderator
    Devshed Supreme Being (6500+ posts)

    Join Date
    Jun 2003
    Posts
    14,429
    Rep Power
    4539
    Make sure cookies are enabled in your browser.

    Make sure you didn't add an <% @EnableSessionState = false %> somewhere in your code.

    There is a pretty extensive discussion of session state here

    http://msdn.microsoft.com/library/de...ngSessions.asp
  4. #3
  5. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2003
    Posts
    7
    Rep Power
    0
    Cheers for the link...however, i'm certain that i both have cookies enabled and have not got any code like that.

    One article from microsoft I was looking at suggested that a security patch stops session state between requests. Link below:

    http://support.microsoft.com/default...b;en-us;316112

    In short, The suggested resolution was to ensure that the server name was alphanumeric (it is) and to browse using the ip address (i was already)

    After a few hours of trying different things, I gave up and went home!

    This morning, I am in the process of reinstalling :@ How annoying
  6. #4
  7. No Profile Picture
    Grumpier old Moderator
    Devshed Supreme Being (6500+ posts)

    Join Date
    Jun 2003
    Posts
    14,429
    Rep Power
    4539
    One other thought, afaik if your redirect is in a different web application from the redirecting page you'll lose your original session state.
  8. #5
  9. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2003
    Posts
    7
    Rep Power
    0
    There was no joy after the reinstall.

    I set all of the settings in iis to be exactly the same as on my development machine (which did work) and still no change.

    Finally, I decided to just start messing about with the settings randomly and guess what, it started working!

    I honestly have no clue what I did or why it works now when it didn't before.

    I think I may have been playing with the application settings so, like Doug G said, i may have put some of my files in a different application.

    Anyway, cheers for your help..no doubt that I will need it again sometime soon!

    Chris
  10. #6
  11. No Profile Picture
    Grumpier old Moderator
    Devshed Supreme Being (6500+ posts)

    Join Date
    Jun 2003
    Posts
    14,429
    Rep Power
    4539
    I'm glad you got it going. Can't argue with success however it occurs

IMN logo majestic logo threadwatch logo seochat tools logo