0

We work on ASP.NET application. There are 2 projects: P1 and P2. The bad thing is when you run P1 it uses a lot of ASPX files from P2. The issue is - we use sessions in both projects and clean them when we leave particular app. But, for some reason some old session variables are still there and I guess there are from previous app. I've tried methods such as: Clear() and Abandon(), but it didn't help. I don't understand how it's possible the old session variables are still there because we removed them.

Alexei Levenkov
  • 98,904
  • 14
  • 127
  • 179
tesicg
  • 3,971
  • 16
  • 62
  • 121
  • 1
    "The problem is that session keys are scoped to the applications, so two applications having the same session key in fact have separate sessions." - a quote from an answer to another question. Not sure if it helps. Comes from here: http://stackoverflow.com/questions/2868316/sharing-sessions-across-applications-using-the-asp-net-session-state-service – S_F Nov 12 '13 at 06:37
  • Side note: I've removed historical reference from your post as unrelated. "They" always write bad code (which is the definition of "they" - "the ones who are not *us* who write perfect code") , there is no need to add it in your post... :) – Alexei Levenkov Nov 12 '13 at 06:51
  • @S_F: But, the SessionID is the same all the time. – tesicg Nov 13 '13 at 05:40

1 Answers1

0

HttpContext.Current.Session.Abandon(); should destroy the current session may be.. that each project using different HttpContext.

you can check the unique Session.SessionID that your application has only single Session context or not.

or just inspect by Chrome > Resources tab > Cookies > [your site domain] find cookie named ASPNET_SessionID for your domain

aifarfa
  • 3,939
  • 2
  • 23
  • 35
  • I've already checked SessionID and there's only one session, which was cleared. The issue is in that when we log as different user the old user name is displayed, not new one. It comes from session, but we removed it from session. I don't understand how it was in session because we cleared it. – tesicg Nov 12 '13 at 06:49
  • SessionID is the same. – tesicg Nov 12 '13 at 12:22