Problem with Login and Logout???

Posted on 2006-03-20
Last Modified: 2008-02-01
Hi all,

I had create form login.aspx and default.aspx with authentication mode="Forms".

The first time I access to system (default.aspx), it redirect to login form . After input user and password the system show default form (it ok).

After that I sign out, by the following code, it redirect to login form (seem ok), but at that time I can access direct default form by type default.aspx in url (the system did not redirect to login form)
        //abandon session

How to solve thia problem? Please help me!

Thank you very much
Question by:xuanthinh
    LVL 9

    Expert Comment

    try to clear out the sessions before singnout and see if that works

    Author Comment

    I had do that but it did not ok
    LVL 33

    Assisted Solution

    Hi xuanthinh,
    Might just be your browser in this case, it may be loading up a cached version.  When you access this default.aspx page unsecured, try hitting refresh in your browser.  If you are redirected, it is a cache issue.

    LVL 12

    Expert Comment

    I'm guessing that you can get to the default form, but if you try and access any other secure form, you might not be able to.

    I think you are having problems with content expiration headers. Your browser may be showing you a previous version of that page.

    Try putting a label that prints the current DateTime at the top of the page (with a format like dd/MM/yyyy HH:mm:ss - the seconds are important). Log in and note what it says. Wait five seconds, then log out. Now type default.aspx in the url as you did before. Does the datetime change or is it the same as when you logged in?

    LVL 12

    Accepted Solution

    Sorry raterus, it took me ages to get round to posting that, i didn't see you had sent the same.

    In addition, then, you can use the following line in your code:

    But, you would need this on every page. To do that you have to create a new base class for your pages, and stick it in something like the OnInit method for that new page base.

    As a quicker alternative, check the properties of your web site in IIS, through the IIS snap-in, and check that you have the Enable Content Expiration under the Http Headers tab set to Expire Immediately, and see if that helps.


    Author Comment

    Thanks for your helps!

    Featured Post

    Looking for New Ways to Advertise?

    Engage with tech pros in our community with native advertising, as a Vendor Expert, and more.

    Join & Write a Comment

    Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
    I recently went through the process of creating a Calendar Control of events with the basis of using a database to keep track of the dates that are selectable, one requirement was to have the selected date pop-up in a simple lightbox.  At first this…
    Sending a Secure fax is easy with eFax Corporate ( First, Just open a new email message.  In the To field, type your recipient's fax number You can even send a secure international fax — just include t…
    In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

    754 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    24 Experts available now in Live!

    Get 1:1 Help Now