In my site I have the nice urls option set to true. I am using the asp.net standard login controls, so I have a user control on my master page with the following code in the loggedin template:
When I go to the url: http://localhost:1234/, which is the site root, and hit the logout button (after previously logging in), nothing happens, it just refreshes the page.
But when I go to http://localhost:1234/default.aspx and logout, it does log me out and redirects correctly.
What is the cause of this strange behaviour and how to fix ?
I've noticed now, that if I run the home page from visual studio and have the following url http://localhost:1234/MySiteName/default.aspx and try to logout, it works fine.
If I try to run it in web matrix, through the umbraco backoffice, and have the default page or any other page like http://localhost:1234/go-further ---- it doesn't logout
the use, just refreshes.
This problem is really annoying, anybody has found a solution ?
logout problem when using nice urls
Hi.
In my site I have the nice urls option set to true. I am using the asp.net standard login controls, so I have a user control on my master page with the following code in the loggedin template:
<LoggedInTemplate>
<div id="login-wrap">
<div id="logged-in-header" class="right">
<div id="logged-in-welcome" class="white">
Welcome, <span class="orange">
<asp:LinkButton ID="FullName" runat="server" PostBackUrl="~/profile"></asp:LinkButton>!</span>
</div>
<div id="logged-in-button" class="grey">
<asp:LoginStatus ID="LoginButton" runat="server" OnLoggedOut="UmbracoLogout" />
</div>
</div>
</div>
</LoggedInTemplate>
The code behind for the logout is:
protected void UmbracoLogout(object sender, EventArgs e)
{
Member.RemoveMemberFromCache(Member.CurrentMemberId());
Member.ClearMemberFromClient(Member.CurrentMemberId());
FormsAuthentication.SignOut();
Roles.DeleteCookie();
HttpContext.Current.Session.Clear();
Response.Redirect("~/installing-modules/", true);
}
my web.config:
<authentication mode="Forms">
<forms name="authCookie" loginUrl="~/login" defaultUrl="~" timeout="2880" protection="All" />
</authentication>
When I go to the url: http://localhost:1234/, which is the site root, and hit the logout button (after previously logging in), nothing happens, it just refreshes the page.
But when I go to http://localhost:1234/default.aspx and logout, it does log me out and redirects correctly.
What is the cause of this strange behaviour and how to fix ?
Thanks.
I've noticed now, that if I run the home page from visual studio and have the following url http://localhost:1234/MySiteName/default.aspx and try to logout, it works fine.
If I try to run it in web matrix, through the umbraco backoffice, and have the default page or any other page like http://localhost:1234/go-further ---- it doesn't logout
the use, just refreshes.
This problem is really annoying, anybody has found a solution ?
It seems that the problem was pretty basic, when removing the link button form the page and replacing it with hyperlink, everything works fine ...
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.