How can I Unauthorize a .NET session

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



I have an app that requires the user to login before accessing a
Register.aspx form. I am using Forms authorization so the lines in the
Web.config file are:

<authentication mode="Forms">
<forms loginUrl="Login.aspx">
</forms>
</authentication>

<authorization>
<deny users="?" /> <!--deny unauthorized users -->
<allow users="*" /> <!-- Allow all authorized users -->
</authorization>

Sure enough when the user browses to the page inside the folder they are
sent to the Login.aspx file. Inside this login file, I check the user
credentials and return to the original page via:

// return to the original page
FormsAuthentication.RedirectFromLoginPage(UserID.Text, false);

In the registration page the user enters some information and then clicks
the Submit button that puts stuff in the SQL server database and transitions
to a confirmation page.

The question now comes, how can I remove the authorization at this point.
If the user goes back to the Registration.aspx (the original page) they can
view the info directly. I want to make the user go through the Login.aspx
sequence again each time they push the Submit button on the information
collecting page.

I don't know how to unauthorize a user session from within the C# code that
is handling the Submit command.

I am using Visual Studio .NET 2003 and C#.

Any advice would be appreciated.

Ed
--
Edward E.L. Mitchell
Phone: (239)415-7039
6707 Daniel Court
Fort Myers, FL 33908


.



Relevant Pages

  • Re: Checking IsAuthenticated for new ASP.NET session
    ... again...my issue is that I do not want to redirect a user to the login ... force authentication by denying authorization to index.aspx for all ... lets say you are an admin user and this is your ... but all the pages now have 5 javascript menus. ...
    (microsoft.public.dotnet.framework.aspnet.security)
  • Re: web.config roles
    ... what i have tried is to use a role based authorization. ... FormsAuthentication login page. ... string encryptedTicket = FormsAuthentication.Encrypt; ... // Create a cookie and add the encrypted ticket as data ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Permit only one network logon per user
    ... authorization on in your app. ... allow a second connection to it using the same creds. ... If user username try to login from a different machine, ...
    (microsoft.public.windows.server.security)
  • Re: web.config roles
    ... login page: ... The authorization works top to bottom your in or your out. ... Your new web.config for the admin folder. ... string encryptedTicket = FormsAuthentication.Encrypt; ...
    (microsoft.public.dotnet.framework.aspnet)
  • asp.net 2.0 roles not working when deploying to web server
    ... The roles implementation works on my development machine but when I ... When I login in as a member of the user role, ...
    (microsoft.public.dotnet.framework.aspnet)