Login / Logout Status and Caching
Hi
I've a small side on which the content updates very rare.
So i wanted to activate the output caching .
But when I activate the output caching (not matter it client or default, or both) i 've some issues concerning the login / logout status.
Forexample user have to click twice Logout before they can see that they are logged out.
I tried the LoginStatus Widged and the "big" LoginControl. both with same behavior.
I tried also to set an redirect to an other page instead of relaod but this didn't help.
Any hints on how to improve the handling ? is there a way to do something like "on login or logout clear cache for this user" ?
If you solve Boas' request it might help me also. This almost seems like a bug. I've set the permissions on a page to not allow anonymous users. It works at first when I am not logged in, redirecting me to the login page. Then, after logging in I can see the page. After I logout however, I can still see the page. That and the login status control still makes it look like I am logged in.
Abraham
Hi Abraham,
Generally you can implement cache substitution control which should solve your issue
sample
<asp:substitution id=
"Substitution1"
methodname=
"GetCurrentUser"
runat=
"server"
>
</asp:substitution>
public
static
string
GetCurrentUser(HttpContext context)
if
(context.User.Identity.IsAuthenticated)
return
context.User.Identity.Name;
return
"annonymous"
;