Groups | Blog | Home
all groups > dotnet faqs > august 2004 >

dotnet faqs : Login issue


Tony Cortese
8/23/2004 8:25:05 AM
[quoted text, click to view]


If you're using cookie, you send a new cookie with the fields cleared.

--
Tony Cortese
--
Send camera phone photos straight to your online photo album plus a loaded
web hosting package for only $4.95/month - No other Fees
Curt_C [MVP]
8/23/2004 8:26:15 AM
Most likely you are tieing your user/pass to the current session so

Session.Abandon()
Session.End()


Curt

[quoted text, click to view]

Alan Ferrandiz [MCT]
8/23/2004 8:36:52 AM
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 =3D DateTime.Now.AddDays(-1)

If using a session variable then you would have to call Session.Abandon =
or set Session("MySession") =3D 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



"Steven" <anonymous@discussions.com> escribi=F3 en el mensaje =
news:#XNsJIRiEHA.3016@tk2msftngp13.phx.gbl...
[quoted text, click to view]
Steven
8/23/2004 6:36:39 PM
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.

hclarius
8/25/2004 12:42:11 PM
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

[quoted text, click to view]

AddThis Social Bookmark Button