How to Sign Out in Asp.Net 2.0?

M

Miguel Dias Moura

Hello,

In my web site I am using Asp.Net 2.0 and "Membership.ValidateUser" 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.ValidateUser" but to
logout. I wasn't able to find it.

Thanks,
Miguel
 
G

Guest

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

Peter
 
A

ammulu

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
FormsAuthentication.SignOut()
'Redirect the user to thieir referring page
Response.Redirect(Request.UrlReferrer.ToString())
End Sub

Regards
Bhar
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top