How to Sign Out in Asp.Net 2.0?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Miguel Dias Moura

    How to Sign Out in Asp.Net 2.0?

    Hello,

    In my web site I am using Asp.Net 2.0 and "Membership.Val idateUser" to
    login a user.
    I didn't use the login controls. I created my own custom look login and
    used membership API.

    I created an image button which says logout. How to I make it logout
    when it is pressed.
    I tried to find a function similar to "Membership.Val idateUser" but to
    logout. I wasn't able to find it.

    Thanks,
    Miguel

  • Peter Bromberg [C# MVP]

    #2
    RE: How to Sign Out in Asp.Net 2.0?

    Miguel,
    If it is using Forms Authentication as I suspect you are, the
    FormsAuthentica tion class has a very handy SignOut method.

    Peter

    --
    Co-founder, Eggheadcafe.com developer portal:

    UnBlog:





    "Miguel Dias Moura" wrote:
    [color=blue]
    > Hello,
    >
    > In my web site I am using Asp.Net 2.0 and "Membership.Val idateUser" to
    > login a user.
    > I didn't use the login controls. I created my own custom look login and
    > used membership API.
    >
    > I created an image button which says logout. How to I make it logout
    > when it is pressed.
    > I tried to find a function similar to "Membership.Val idateUser" but to
    > logout. I wasn't able to find it.
    >
    > Thanks,
    > Miguel
    >
    >[/color]

    Comment

    • Juan T. Llibre

      #3
      Re: How to Sign Out in Asp.Net 2.0?

      See :


      and
      Learn with interactive lessons and technical documentation, earn professional development hours and certifications, and connect with the community.


      Basically, look into LoginControl.Lo gout





      Juan T. Llibre, asp.net MVP
      aspnetfaq.com : http://www.aspnetfaq.com/
      asp.net faq : http://asp.net.do/faq/
      foros de asp.net, en español : http://asp.net.do/foros/
      =============== =============== =====
      "Miguel Dias Moura" <md*REMOVE*mour a@gmail*NOSPAM* .com> wrote in message
      news:O%23oswY4S GHA.4264@TK2MSF TNGP11.phx.gbl. ..[color=blue]
      > Hello,
      >
      > In my web site I am using Asp.Net 2.0 and "Membership.Val idateUser" to login a user.
      > I didn't use the login controls. I created my own custom look login and used membership API.
      >
      > I created an image button which says logout. How to I make it logout when it is pressed.
      > I tried to find a function similar to "Membership.Val idateUser" but to logout. I wasn't able to
      > find it.
      >
      > Thanks,
      > Miguel
      >[/color]


      Comment

      • Juan T. Llibre

        #4
        Re: How to Sign Out in Asp.Net 2.0?

        Additionally, see :
        Detects the user's authentication state and toggles the state of a link to log in to or log out of a Web site.


        When the user is logged in to the Web site,
        the LoginStatus control provides a link to log out of the Web site.



        Juan T. Llibre, asp.net MVP
        aspnetfaq.com : http://www.aspnetfaq.com/
        asp.net faq : http://asp.net.do/faq/
        foros de asp.net, en español : http://asp.net.do/foros/
        =============== =============== =====
        "Juan T. Llibre" <nomailreplies@ nowhere.com> wrote in message
        news:ukddI94SGH A.4960@TK2MSFTN GP12.phx.gbl...[color=blue]
        > See :
        >
        > http://aspnet.4guysfromrolla.com/articles/120705-1.aspx
        > and
        > http://msdn.microsoft.com/msdnmag/is...NET20Security/
        >
        > Basically, look into LoginControl.Lo gout
        >
        >
        >
        >
        >
        > Juan T. Llibre, asp.net MVP
        > aspnetfaq.com : http://www.aspnetfaq.com/
        > asp.net faq : http://asp.net.do/faq/
        > foros de asp.net, en español : http://asp.net.do/foros/
        > =============== =============== =====
        > "Miguel Dias Moura" <md*REMOVE*mour a@gmail*NOSPAM* .com> wrote in message
        > news:O%23oswY4S GHA.4264@TK2MSF TNGP11.phx.gbl. ..[color=green]
        >> Hello,
        >>
        >> In my web site I am using Asp.Net 2.0 and "Membership.Val idateUser" to login a user.
        >> I didn't use the login controls. I created my own custom look login and used membership API.
        >>
        >> I created an image button which says logout. How to I make it logout when it is pressed.
        >> I tried to find a function similar to "Membership.Val idateUser" but to logout. I wasn't able to
        >> find it.
        >>
        >> Thanks,
        >> Miguel
        >>[/color]
        >
        >[/color]


        Comment

        • Miguel Dias Moura

          #5
          Re: How to Sign Out in Asp.Net 2.0?

          Thank you all. It was exactly that what I was looking.

          Cheers,
          Miguel

          "Juan T. Llibre" <nomailreplies@ nowhere.com> wrote in message
          news:#V7E7$4SGH A.1236@TK2MSFTN GP11.phx.gbl:
          [color=blue]
          > Additionally, see :
          > http://msdn2.microsoft.com/en-us/lib...us(VS.80).aspx
          >
          > When the user is logged in to the Web site,
          > the LoginStatus control provides a link to log out of the Web site.
          >
          >
          >
          > Juan T. Llibre, asp.net MVP
          > aspnetfaq.com : http://www.aspnetfaq.com/
          > asp.net faq : http://asp.net.do/faq/
          > foros de asp.net, en español : http://asp.net.do/foros/
          > =============== =============== =====
          > "Juan T. Llibre" <nomailreplies@ nowhere.com> wrote in message
          > news:ukddI94SGH A.4960@TK2MSFTN GP12.phx.gbl...
          >[color=green]
          > > See :
          > >
          > > http://aspnet.4guysfromrolla.com/articles/120705-1.aspx
          > > and
          > > http://msdn.microsoft.com/msdnmag/is...NET20Security/
          > >
          > > Basically, look into LoginControl.Lo gout
          > >
          > >
          > >
          > >
          > >
          > > Juan T. Llibre, asp.net MVP
          > > aspnetfaq.com : http://www.aspnetfaq.com/
          > > asp.net faq : http://asp.net.do/faq/
          > > foros de asp.net, en español : http://asp.net.do/foros/
          > > =============== =============== =====
          > > "Miguel Dias Moura" <md*REMOVE*mour a@gmail*NOSPAM* .com> wrote in message
          > > news:O%23oswY4S GHA.4264@TK2MSF TNGP11.phx.gbl. ..[/color]
          >[color=green][color=darkred]
          > >> Hello,
          > >>
          > >> In my web site I am using Asp.Net 2.0 and "Membership.Val idateUser" to login a user.
          > >> I didn't use the login controls. I created my own custom look login and used membership API.
          > >>
          > >> I created an image button which says logout. How to I make it logout when it is pressed.
          > >> I tried to find a function similar to "Membership.Val idateUser" but to logout. I wasn't able to
          > >> find it.
          > >>
          > >> Thanks,
          > >> Miguel
          > >>[/color]
          > >[/color]
          >[color=green]
          > >[/color][/color]

          Comment

          • ammulu

            #6
            Re: How to Sign Out in Asp.Net 2.0?

            Hi,

            Log on to:http://www.vkinfotek.com

            Briefly the code for SignOut

            Sub SignOut(ByVal objSender As Object, ByVal objArgs As EventArgs)
            'Delete the cookie and signout
            FormsAuthentica tion.SignOut()
            'Redirect the user to thieir referring page
            Response.Redire ct(Request.UrlR eferrer.ToStrin g())
            End Sub

            Regards
            Bhar

            Comment

            Working...