HttpContext.Current.User returns old user id

Discussion in 'ASP .Net' started by Dwight Johnson, Feb 16, 2010.

  1. In my web app I get the logged in user's id using
    HttpContext.Current.User. I can then compare this to ActiveDirectory
    to authenticate, and off we go.

    However, recently a woman at my company got married, and wanted to
    change her login name to use her new married name. No problem. Except
    when she ran my web app. Whenever she did, and hit the code that got
    her user id from HttpContext.Current.User, it returned her old id,
    which no longer existed in AD (hence, she definitely was not logging
    in using her old id). The problem persisted for several days.

    One purported solution was found here ( http://support.microsoft.com/kb/946358
    ), but this did not fix it. Finally, someone did an IISRESET on the
    server, and that appears to have solved the problem.

    Any thoughts on what might have happened here?
     
    Dwight Johnson, Feb 16, 2010
    #1
    1. Advertising

  2. On Feb 16, 6:52 pm, Dwight Johnson <> wrote:
    > In my web app I get the logged in user's id using
    > HttpContext.Current.User. I can then compare this to ActiveDirectory
    > to authenticate, and off we go.
    >
    > However, recently a woman at my company got married, and wanted to
    > change her login name to use her new married name. No problem. Except
    > when she ran my web app. Whenever she did, and hit the code that got
    > her user id from HttpContext.Current.User, it returned her old id,
    > which no longer existed in AD (hence, she definitely was not logging
    > in using her old id). The problem persisted for several days.
    >
    > One purported solution was found here (http://support.microsoft.com/kb/946358
    > ), but this did not fix it. Finally, someone did an IISRESET on the
    > server, and that appears to have solved the problem.
    >
    > Any thoughts on what might have happened here?


    I'm not sure because you didn't provide enough information on how the
    authentication work in your application. Usually changing cache
    behaviors via registry settings works (see: http://support.microsoft.com/kb/946358)
    Maybe it also cached somewhere in your application?
     
    Alexey Smirnov, Feb 28, 2010
    #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. Mike Newton
    Replies:
    0
    Views:
    2,923
    Mike Newton
    Jul 23, 2004
  2. Replies:
    4
    Views:
    1,035
  3. Randy
    Replies:
    1
    Views:
    690
    Joe Kaplan \(MVP - ADSI\)
    Sep 2, 2004
  4. Tony

    Dim context As HttpContext = HttpContext.Current

    Tony, Mar 2, 2004, in forum: ASP .Net Web Controls
    Replies:
    2
    Views:
    318
    Teemu Keiski
    Mar 3, 2004
  5. Antonio O''Neal
    Replies:
    3
    Views:
    806
    Bob Barrows
    Dec 2, 2009
Loading...

Share This Page