-
Forms Authentication, Frames, and the SignOut Method
I have designed an ASPX web page that contains 3 frames: header, left side
navbar, and main frame. I am using Forms Authentication with a SQL database
to store the info. The RedirectFromLoginPage works great when authentication
is approved. I have a "Sign Out" button on the navbar frame that calls FormsAuthentication.SignOut,
which kills the authentication cookie and then redirects the user back to
the login page.
Here's the problem: I want the entire page to go back to the Login page,
but only the Navbar frame gets redirected - the other 2 frames stay the same.
And if I refresh either of the other 2 frames, it then loads its own instance
of the Login page because the cookie is gone.
How do I get the entire set of 3 frames to be replaced by the initial login
page instead of just one frame getting the page instance?
By the way, if I just hit F5 or hit the Refresh button up on the toolbar
of the browser, it does reload the entire page into the Login Page. It's
just in the Click Event of the Sign Out button that the problem occurs.
Thanks in advance.
-
Re: Forms Authentication, Frames, and the SignOut Method
Todd Willoughby <aspx@gladiatori.com> wrote:
>
> I have designed an ASPX web page that contains 3 frames: header, left side
> navbar, and main frame. I am using Forms Authentication with a SQL database
> to store the info. The RedirectFromLoginPage works great when authentication
> is approved. I have a "Sign Out" button on the navbar frame that calls
> FormsAuthentication.SignOut,
> which kills the authentication cookie and then redirects the user back to
> the login page.
>
> Here's the problem: I want the entire page to go back to the Login page,
> but only the Navbar frame gets redirected - the other 2 frames stay the same.
> And if I refresh either of the other 2 frames, it then loads its own instance
> of the Login page because the cookie is gone.
>
> How do I get the entire set of 3 frames to be replaced by the initial login
> page instead of just one frame getting the page instance?
Either
1) Drop a bit of client-side JavaScript into the onload event of the
login page to force it to the top level (you should be able to find code
for this on the web).
or
2) Build a dedicated log out page, and replace the sign out button with
a simple hyperlink to it (with the target property set to "_top").
--
Dave Rothgery
Picking nits since 1976
drothgery@alum.wpi.edu
http://drothgery.editthispage.com
-
Re: Forms Authentication, Frames, and the SignOut Method
I'm guessing that this is a pretty common problem with framesets. I do not
use them but I do use IFRAME in a lot of my pages. It has been my experiance
that most programmers do not like using the framesets. I have found a few
instances where and frame is a good idea but I use the IFRAME instead.
The only way I can get the actual browser itself to reload and not the IFRAME,
or in your case the navbar frame.
Eventhough you not using Javascript you are probably doing is some that is
the equivalent of the following JavaScript.
self.location = "url"
Try this...
Window.location = "url"
If you need to embed it as an HREF or something from within the page... try
something like...
<A HREF="javascript:Window.location = 'url.aspx'">
<img name="btnAdd" src="../Images/buttons/add<%=Session("Access")%>
.gif" BORDER="0" onMouseOver="this.style.cursor='hand'">
</A>
"Todd Willoughby" <aspx@gladiatori.com> wrote:
>
>I have designed an ASPX web page that contains 3 frames: header, left side
>navbar, and main frame. I am using Forms Authentication with a SQL database
>to store the info. The RedirectFromLoginPage works great when authentication
>is approved. I have a "Sign Out" button on the navbar frame that calls
FormsAuthentication.SignOut,
>which kills the authentication cookie and then redirects the user back to
>the login page.
>
>Here's the problem: I want the entire page to go back to the Login page,
>but only the Navbar frame gets redirected - the other 2 frames stay the
same.
> And if I refresh either of the other 2 frames, it then loads its own instance
>of the Login page because the cookie is gone.
>
>How do I get the entire set of 3 frames to be replaced by the initial login
>page instead of just one frame getting the page instance?
>
>By the way, if I just hit F5 or hit the Refresh button up on the toolbar
>of the browser, it does reload the entire page into the Login Page. It's
>just in the Click Event of the Sign Out button that the problem occurs.
>
>Thanks in advance.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks