Session Data seems to be limited to individual folders

Discussion in 'ASP.NET 2.0' started by Bruce, Aug 27, 2006.

  1. Bruce

    Bruce DiscountASP.NET Staff

    is /User and /Calender different IIS applications?

    Session variables scope is per application.

    Bruce

    DiscountASP.NET
    www.DiscountASP.NET
     
  2. ok, I'm having a bit of trouble with my session data and i have no idea why. It was working perfectly for almost a week, i changed nothing, now it's behaving in a way i've never seen it before.



    Basicly, these are some of my folders:

    root/ (contains the news page, my page that redirects you to the correct subdomain, etc)
    root/Users/(Contains login, register, user settings pages etc etc)
    root/Calender/ (Contains the pages for the calendar/scheduler i'm working on)


    When a user logs in his user info is stored in a session variable (name, timezone, etc).

    Now, my problem is, that session data is only being used in the folder of the page that added it. If a page in the /Calendar/ folder tries to access session("User") it will see it as null, even though the login page entered an object into it. Then if i go back to a page in the /Users/ folder, that page will see the data that was entered into session("User") correctly.

    What seems to be happening is the folders are keeping their own session data. But honestly i wouldn't know how to do that if i wanted too, this just went and did it somehow on it's own without me changing anything.

    I'm thinking about trying that new iis command to reset session data but if that does fix it, i still won't know what caused it or if it will happen again.
     
  3. Bruce

    Bruce DiscountASP.NET Staff

    that's very strange!!


    Anyway, glad you got this fixed.


    Bruce

    DiscountASP.NET
    www.DiscountASP.NET
     
  4. no, it's one application.

    I got it working again, but i still don't really understand what the problem was.

    When the use logs in, they're redirected back to the main page with Response.Redirect("site-name.com"), i changed that to Response.Redirect("site-name.com/Default.aspx") and now the problems gone. It's goes to the exact same page, but somehow setting the link to it explicitly rather than just letting it default to it fixed it.
     

Share This Page