RE: [aus-dotnet] Synchronise Session and Authentication...


    [Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
    • From: Mukesh R Bhakta
    • Subject: RE: [aus-dotnet] Synchronise Session and Authentication...
    • Date: Sat, 29 Oct 2005 12:30:27 +1000

    Jonathon,
    
    You must remember - in .NET exceptions are 'costly' you are better off
    checking for nulls yourself rather than throwing exceptions like you would
    do in unmanaged C++. Use exceptions only if 'NECESSARY'.
    
    Cheers
    
    MB
    
    -----Original Message-----
    From: peter@xxxxxxxxxxx [mailto:peter@xxxxxxxxxxx] On Behalf Of Jonathon
    Kresner
    Sent: Saturday, October 29, 2005 11:43 AM
    To: dotnet@xxxxxxxxxxx
    Subject: Re: [aus-dotnet] Synchronise Session and Authentication...
    
    I have not been programming in .NET for long, and this
    method seems like a hack to me, but I have been doing
    something like the following:
    
    
    try { (Session["email"].ToString(); }
    catch { Response.Redirect("index.aspx?Signout=True");
    }
    
    
    Basically, if the session has expired, the all the
    session objects will be null and they will throw an
    exception...
    
    It pretty easy to code / understand, but I'm all
    ears for a better method!
    
    Jonathon Kresner
    
    
    --- Matt Bourne <matt.bourne@xxxxxxxxx> wrote:
    
    > One option which I have used is to use a HttpModule
    > that would detect the
    > presence of the FormsAuthentication identity as well
    > as a session at
    > the OnAcquireRequestState
    > event, if only one (session or authentication) was
    > present, then clear the
    > one not present - e.g.
    > FormsAuthentication.SignOut();or
    > HttpContext.Current.Session.Abandon(); - and then
    > redirect to the login
    > page.
    >  Regards
    > Matt Bourne
    > http://blogs.worldnomads.com.au/matthewb/
    > 
    >  On 10/28/05, .net noobie <dotnetnoobie@xxxxxxxxx>
    > wrote:
    > >
    > >
    > >
    >
    http://www.google.com.au/search?hl=en&q=synchronizing+a+session+with+forms+a
    uthentication&spell=1
    > >
    > > On 10/27/05, list <list@xxxxxxxxxxxxxxx> wrote:
    > > >
    > > > Anyone got any experience synchronising a
    > session with forms
    > > > authentication.
    > > >  How do I expire a session when you are not
    > authenticated and how do I
    > > > unauthenticated when session expires.
    > > >   Anthony Salerno
    > > >
    > >
    > >
    > >
    > > --
    > > .net noobie
    > > http://www.dotnetnoobie.com
    > 
    
    
    
    		
    ____________________________________________________ 
    Do you Yahoo!? 
    The New Yahoo! Movies: Check out the Latest Trailers, Premiere Photos and
    full Actor Database. 
    http://au.movies.yahoo.com
    _________________
    You are a part of the Ausralian "dotnet" mailing list. To unsubscribe send
    "unsubscribe dotnet" or to re-subscribe send "subscribe dotnet" in the body
    of the email to: imailsrv@xxxxxxxxxxx 
    List Managed by www.stanski.com and Proudly Sponsored by www.ico.com.au
    
    
    -- 
    No virus found in this incoming message.
    Checked by AVG Free Edition.
    Version: 7.1.362 / Virus Database: 267.12.6/151 - Release Date: 28/10/2005
     
    
    -- 
    No virus found in this outgoing message.
    Checked by AVG Free Edition.
    Version: 7.1.362 / Virus Database: 267.12.6/151 - Release Date: 28/10/2005
     
    _________________
    You are a part of the Ausralian "dotnet" mailing list. To unsubscribe send "unsubscribe dotnet" or to re-subscribe send "subscribe dotnet" in the body of the email to: imailsrv@xxxxxxxxxxx 
    List Managed by www.stanski.com and Proudly Sponsored by www.ico.com.au
    
    



    (Click here for more information on the aus-dotnet mailling list)