Login issue

  • Thread starter Thread starter Steven
  • Start date Start date
S

Steven

Hi,
I have created a web page where I enter my login id, password, and then my
page connects to my database to see if the user is authenticated. If he is,
he can proceed further with other pages.
Please help me to knbow how do I log out a user once logged in? Just reset
the connection to database?
Is there a proper way to do this?
Thanks.
 
Most likely you are tieing your user/pass to the current session so

Session.Abandon()
Session.End()


Curt
 
I do not quite understand what your scenario is but it mainly depends on what authentication mechanism you are using. What do you mean by "logged in"??'
Do you create a cookie? a session variable?? are you using Forms Authentication??

If using Forms Authentication then you would have to call the SignOut method


System.Web.Security.FormsAuthentication.SignOut()

If using an authentication personalized cookie then you would have to set it to a date that already passed

myCookie.Expires = DateTime.Now.AddDays(-1)

If using a session variable then you would have to call Session.Abandon or set Session("MySession") = Nothing or set a flag in a session variable to indicate that the user is not logged in anymore

Anyway IMHO resetting the connection to the database would not make an accurate solution. Please detail your scenario

Hope this helps

Alan Ferrandiz Langley
MCDBA, MCT, MSF Practitioner
 
Hi,
I have created a web page where I enter my login id, password, and then my
page connects to my database to see if the user is authenticated. If he is,
he can proceed further with other pages.
Please help me to knbow how do I log out a user once logged in? Just reset
the connection to database?
Is there a proper way to do this?
Thanks.


If you're using cookie, you send a new cookie with the fields cleared.
 
I set up the connection string with the USE AND PASSWORD. I open the
connection and check for errors.

Set Con = Server.CreateObject("ADODB.Connection")
Con.ConnectionTimeout=40
U=Request.Form("USER_ID")
P=Request.Form("Password")
ConStr="Provider=MSDASQL.1;Password=" & P & ";Persist Security
Info=True;User ID=" & U & ";Data Source=XXX"
Con.Open ConStr
If Err.Number<>0 Then
Authorized=0
Else
Authorized=1
End If
Con.Close
Set Con=Nothing
 

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

Back
Top