Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Security > Crazy Logouts

Reply
Thread Tools

Crazy Logouts

 
 
Arthur Dent
Guest
Posts: n/a
 
      09-06-2006
Help please! I am pulling my hair out here!

i have a forms authentication app, which regularly (not all the time though)
gives me a page on a protected directory which says "The website declined to
show this webpage. Most likely causes: This website requires you to log in."
I cannot figure out for the life of me, if it is not logged in, why is it
not simply redirecting to the login page, instead of giving me this stupid
browser error page?

Here is my relevant code. The pages in the protected directory are also
killing their cache using the following code:
Response.Cache.SetNoServerCaching()
Response.Cache.SetCacheability(System.Web.HttpCach eability.NoCache)Response.Cache.SetNoStore()
Response.Cache.SetExpires(New DateTime(1900, 1, 1, 0, 0, 0, 0))
I tried it with or without that though, and it didnt change my problem.

WEB.CONFIG:
<authentication mode="Forms">
<forms name="mysiteAUTH" loginUrl="login.aspx"
defaultUrl="index.aspx" protection="All" timeout="120"
slidingExpiration="true"/>
</authentication>
<location path="admin">
<system.web>
<authorization>
<deny roles="AccessDenied"/>
<allow roles="Administrator"/>
<deny users="?,*" />
</authorization>
</system.web>
</location>

GLOBAL.ASAX:
Sub Application_AuthenticateRequest(ByVal sender As Object, ByVal e As
EventArgs)
If Request.IsAuthenticated Then
'// ADD CUSTOM ROLES FROM DB TABLE
Dim setting As String = Context.User.Identity.Name &
General.HandleUserRoles
HttpContext.Current.User = New GenericPrincipal(User.Identity,
CType(Application(setting), String()))
End If
End Sub
Sub Session_Start(ByVal sender As Object, ByVal e As EventArgs)
Session(General.HandleLastEx) = New Exception
Session(General.HandleSessionUser) = New Definitions.UserBase
End Sub


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
crazy browser go crazy dr greg Computer Support 7 01-14-2005 09:13 PM
Something Crazy Happened !!! nikoli Firefox 0 12-12-2003 04:22 AM
------- Crazy XP ------- HELP !!!!!!! Pavel Microsoft Certification 4 09-30-2003 02:28 PM
Little 837 is going crazy G Cisco 0 07-15-2003 07:10 AM



Advertisments