Session expires before forms authentication timeouts within a frameset

Last post 02-18-2008 4:42 AM by DavidKiff. 5 replies.

Sort Posts:

  • Session expires before forms authentication timeouts within a frameset

    02-17-2008, 2:05 AM
    • Loading...
    • danal
    • Joined on 04-29-2004, 8:31 AM
    • Posts 70

    Hello,

    I am developing a ASP.NET web application using a frameset.
    I have a header frame and a lower frame. The lower frame is divided to a left frame (which displays a menu) and a right frame which is my main frame in the application.
    I am also using forms authentication.
    When the session expires before the forms authentication timeouts, i am redirecting to my login page.
    The problem is that after logging in again, the while frameset is placed in my main frame, so that now I have a frameset within a framset.

    What should I do to fix that?

     

    I use this function to check if the session has expired:
     
    private void getVar()
    {
      if (Session["myVar"] != null)
      {
        Password = Session["myVar"].ToString();
      }
      else
      {
        Session.Clear();
        FormsAuthentication.SignOut();
        Response.Redirect("../main.htm");
      }
    }
    

    Thank you,

    Dana

  • Re: Session expires before forms authentication timeouts within a frameset

    02-17-2008, 5:57 AM
    Answer
    • Loading...
    • DavidKiff
    • Joined on 12-07-2006, 6:07 PM
    • Hertfordshire, UK
    • Posts 1,634

    Nooo!  Framesets :(  They are very old fashioned, and there are so many reasons not to use them (including this post!)!!  In asp.net they have a cool feature called master pages.  I would strongly recommend looking at them instead:)  They are not hard to use and will save you time later :)

     

    David Kiff
    http://DavidKiff.co.uk

    -- "Mark As Answer" If my reply helped you --
  • Re: Session expires before forms authentication timeouts within a frameset

    02-17-2008, 8:14 AM
    • Loading...
    • danal
    • Joined on 04-29-2004, 8:31 AM
    • Posts 70

     

    Thank you for your reply. I know master pages and I've been using them in some other applications, but in this application the header changes and the left frame changes, so I thought I cannot use master pages.

    I am using the header to show the application tabs. The user can switch between the tabs and so the header changes accordingly.

    Am I still doing wrong using frameset and not master pages?

     

  • Re: Session expires before forms authentication timeouts within a frameset

    02-17-2008, 8:36 AM
    Answer
    • Loading...
    • DavidKiff
    • Joined on 12-07-2006, 6:07 PM
    • Hertfordshire, UK
    • Posts 1,634

    In my opinion.. yes!  Why can you not have a content place holder within the header section of the page?  Then you can add what ever you like to it from other pages?  If the left changes add a content place holder there as well :)

    David Kiff
    http://DavidKiff.co.uk

    -- "Mark As Answer" If my reply helped you --
  • Re: Session expires before forms authentication timeouts within a frameset

    02-18-2008, 1:06 AM
    • Loading...
    • danal
    • Joined on 04-29-2004, 8:31 AM
    • Posts 70

    Thank you,

    I'll do that

  • Re: Session expires before forms authentication timeouts within a frameset

    02-18-2008, 4:42 AM
    • Loading...
    • DavidKiff
    • Joined on 12-07-2006, 6:07 PM
    • Hertfordshire, UK
    • Posts 1,634

    No problem,  could you "mark as answer" if any of the helped you?

    Regards,

    David Kiff
    http://DavidKiff.co.uk

    -- "Mark As Answer" If my reply helped you --
Page 1 of 1 (6 items)
Microsoft Communities
Page view counter