winform security: strange error, where as I expected a redirect

Tech-Archive recommends: Speed Up your PC by fixing your registry



Hi,

I have a statement :
Session["username"].ToString();
somewhere in code and of course it gets the username from the session that I stored earlier. Now I have security configured in the web.config, as :

<authentication mode="Forms">
<forms loginUrl="login.aspx" protection="All">
<credentials passwordFormat="Clear">
<user name ="jack" password="jack"/>
<user name="alan" password="alan"/>

</credentials>
</forms>
</authentication>
<authorization>
<deny users="?" />
</authorization>

when we dont have session, the security code takes care of redirecting the users to the login page in case they try to access any page without authentication. But sometimes its happening that in the statament:
Session["username"].ToString();
I get a "object reference not set to instance of an object", which i completely understand that it couldnt find Session ["username"] and so the ToString() failed. But my question is if the session no more contains "username" (it did few minutes back) it means the session got destroyed right? So that means that asp.net security should not even let this page execute its code and redirect to the log in page right?
So whats happening, why the execution if no session and the security in place?

Thanks,

...ab

.



Relevant Pages

  • Re: Desktop Creation
    ... Your statement only gives one small piece of the security picture. ... The reason for no desktop window access by services is that an unsecured ... session 1 and communicate with an IPC with the SYSTEM service. ... API evolution. ...
    (microsoft.public.win32.programmer.kernel)
  • [UNIX] TWiki Arbitrary Code Execution in Session Files
    ... Get your security news from a reliable source. ... TWiki Arbitrary Code Execution in Session Files ... or via an HTTP vulnerability of a third party web application. ...
    (Securiteam)
  • Re: Desktop Creation
    ... If I must store a secret I use CryptProtectDataAPI. ... But I don't understand what the resource creation is a potential security ... CreateDekstopuse the attached window station of the processus that call ... session 1 and communicate with an IPC with the SYSTEM service. ...
    (microsoft.public.win32.programmer.kernel)
  • Re: Login in dynamically
    ... different from or nothing to do with the provisions of Access ULS. ... I mean, there's enough damn security permissions to set, how many do you want ... security as per transaction and not per application session. ...
    (microsoft.public.access.security)
  • Re: Web session tracking security prob. Vulnerable: IIS and ColdFusion (maybe others)
    ... IIS and ColdFusion ... Because we perceive this as a security problem, our intent is to be wary of any web application that relies on IIS' session tracking. ...
    (Vuln-Dev)