I want Forms Authentication only during session

Discussion in 'ASP .Net Security' started by Peter Royle, Dec 4, 2003.

  1. Peter Royle

    Peter Royle Guest

    Hello out there,

    I am building an ASP.NET app that uses Forms authentication (as that
    seems the simplest way to do it). It works fine "out of the box". But
    what I would like is for the authentication to last only for a user's
    session, then the next time they try to connect, they are given the
    Login.aspx form again (their environment is not secure, so I want to
    force a logon each time). I'm not clear how I can achieve that.

    Any (simple) suggestions?

    Cheers,
    Peter Royle
    Peter Royle, Dec 4, 2003
    #1
    1. Advertising

  2. Peter Royle

    Paul Hobbs Guest

    This is very simple to implement:

    When the user is authenticated, and you set the session cookie, make the
    Persistent Cookie parameter False:

    FormsAuthentication.RedirectFromLoginPage(tbEmail.Text, False)

    Hope this helps,

    Paul Hobbs



    "Peter Royle" <> wrote in message
    news:...
    > Hello out there,
    >
    > I am building an ASP.NET app that uses Forms authentication (as that
    > seems the simplest way to do it). It works fine "out of the box". But
    > what I would like is for the authentication to last only for a user's
    > session, then the next time they try to connect, they are given the
    > Login.aspx form again (their environment is not secure, so I want to
    > force a logon each time). I'm not clear how I can achieve that.
    >
    > Any (simple) suggestions?
    >
    > Cheers,
    > Peter Royle
    Paul Hobbs, Dec 4, 2003
    #2
    1. Advertising

  3. Peter Royle

    Peter Royle Guest

    "Paul Hobbs" <> wrote in message news:<#>...
    > This is very simple to implement:
    >
    > When the user is authenticated, and you set the session cookie, make the
    > Persistent Cookie parameter False:
    >
    > FormsAuthentication.RedirectFromLoginPage(tbEmail.Text, False)
    >
    > Hope this helps,
    >
    > Paul Hobbs


    Thanks, Paul. That's what I wanted. I knew I'd seen it somewhere!

    Peter
    Peter Royle, Dec 5, 2003
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Andre
    Replies:
    2
    Views:
    343
    nfedin
    Feb 10, 2004
  2. Eric
    Replies:
    2
    Views:
    1,457
    Tommy
    Feb 13, 2004
  3. Replies:
    0
    Views:
    376
  4. Eric
    Replies:
    2
    Views:
    499
  5. chrism
    Replies:
    12
    Views:
    316
    David Graham
    Nov 22, 2003
Loading...

Share This Page