ASP.NET randomly losing session values

后端 未结 6 1295
一整个雨季
一整个雨季 2021-02-14 19:22

I\'ve been searching for answers for quite some time on this as it continues to plague me. We store user login info and other data about the user\'s current activities in Sessi

6条回答
  •  南笙
    南笙 (楼主)
    2021-02-14 20:03

    Since it took me a while to figure this one out, I thought I'd post this here in case it helps someone else too.

    I ran into a situation where both IE and Chrome were randomly dropping session variables too. I searched and searched and everyone said the usual things...check domain name, check your IIS settings for cookies...etc.

    My issue turned out to be a permissions thing.

    In my web.config, I have a permission entry for a 'public' folder that can be accessed by the unauthenticated public.

    
    
      
        
        
      
    
    

    The problem was a public-side .js call to a HttpHandler that was NOT on the public side. In an attempt to reuse code, I pointed both the secure and public side to code in the secure side. I guess as a side effect, it killed the session, without a very meaningful error message.

    I may add another entry just for that handler, or I may make a public and a secure copy of that code (a less desired approach).

提交回复
热议问题