Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 256371
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T22:00:31+00:00 2026-05-11T22:00:31+00:00

We’ve got a WSS 3.0 site that is using Forms Based Authentication (FBA). We

  • 0

We’ve got a WSS 3.0 site that is using Forms Based Authentication (FBA). We want to set the site up so that certain users can be logged in automatically, rather then getting the login screen, and I’m not sure of the best way to do this.

Actually, based on this article, I’ve already created an HTTP Module that handles the logging in. More specifically, I’ve created an alternate login page, and when that page is hit it logs in as the desired user. But, it keeps the user logged in after I close the browser down. That is, I start up the browser, go to the alternate login page, my HTTP Module code gets triggered and logs in as the desired user, then I close the browser down. When I then try to go to the site, the standard login page of the site is skipped over because I’m still logged into the site as the earlier user.

I guess my question comes down to how can I make sure I log off? Is there a way to do this with HTTP Modules/Handlers, or do I want to do something in global.asax?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-11T22:00:31+00:00Added an answer on May 11, 2026 at 10:00 pm

    Silly me. I had the cookie parameter of my FormsAuthentication.RedirectFromLoginPage command set to True. That means the authentication cookie will be persisted for 50 years. What I wanted was to have the cookie to go away when the browser was closed. That’s easily done if the cookie parameter is set to False. Here’s my code if anyone is interested…

    Imports System.Web
    Imports System.Web.Security
    Imports System.Collections.Specialized
    Imports System.Security.Principal
    Imports System.Threading
    Imports System.Web.UI
    
    Public Class AuthModule
        Implements IHttpModule
    
        Public Sub Dispose() Implements System.Web.IHttpModule.Dispose
        End Sub
    
        Public Sub Init(ByVal app As System.Web.HttpApplication) Implements System.Web.IHttpModule.Init
            AddHandler app.PreRequestHandlerExecute, New EventHandler(AddressOf OnPreRequestHandlerExecute)
        End Sub
    
        Public Sub OnPreRequestHandlerExecute(ByVal sender As Object, _
                                                ByVal e As EventArgs)
    
            ' Check to see if the alternate page has been accessed
            If HttpContext.Current.Request.Url.ToString.ToUpper.EndsWith("AUTOLOGIN.ASPX") Then
                ' Alternate page has been accessed, so log in using predetermined account
    
                ' Retrieve the user name and password
                Dim userName As String = "user"
                Dim userPassword As String = "password"
    
                ' Build the user id
                Dim roles As String() = Nothing
                Dim webIdentity As New GenericIdentity(userName, "Form")
                Dim principal As New GenericPrincipal(webIdentity, roles)
    
                ' Specify the user
                HttpContext.Current.User = principal
                Thread.CurrentPrincipal = principal
    
                ' Redirect from the login page to the start page
    ' Note, this is the line I initially had incorrect.  That is, I had the
    ' second parameter set to True, which will persist the authentication cookie.
    ' Setting the second parameter to False will cause the authentication cookie
    ' to go away when the browser is closed.  Yeah!
                FormsAuthentication.RedirectFromLoginPage(HttpContext.Current.User.Identity.Name.ToString, False)
            End If
    
        End Sub
    
    End Class
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've got a string that has curly quotes in it. I'd like to replace
I want to count how many characters a certain string has in PHP, but
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
i got an object with contents of html markup in it, for example: string
link Im having trouble converting the html entites into html characters, (&# 8217;) i
Does anyone know how can I replace this 2 symbol below from the string
We're building an app, our first using Rails 3, and we're having to build
I'm making a simple page using Google Maps API 3. My first. One marker
We are using XSLT to translate a RIXML file to XML. Our RIXML contains
i want to parse a xhtml file and display in UITableView. what is the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.