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

  • Home
  • SEARCH
  • 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

Ask A Question

Stats

  • Questions 183k
  • Answers 183k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer There is no one "best" way. Another way to do… May 12, 2026 at 4:36 pm
  • Editorial Team
    Editorial Team added an answer it's put(..) not add(..) you're trying to add KeyWrapper and… May 12, 2026 at 4:36 pm
  • Editorial Team
    Editorial Team added an answer You don't need to do that cast, as you can… May 12, 2026 at 4:36 pm

Related Questions

We are developing a little application that given a directory with PDF files creates
We have been using CruiseControl for quite a while with NUnit and NAnt. For
We have a requirement in project to store all the revisions(Change History) for the
We have a remoting singleton server running in a separate windows service (let's call
We have an SVN repository running on a Windows server, and I want to

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.