Thursday, March 22, 2012

Login issue

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

"Steven" <anonymous@.discussions.com> wrote in message
news:%23XNsJIRiEHA.3016@.tk2msftngp13.phx.gbl...
> 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.
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

"Steven" <anonymous@.discussions.com> escribi en el mensaje news:#XNsJIRiEHA.3016@.tk2msftngp13.phx.gbl...
> 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.
>
On Mon, 23 Aug 2004 18:36:39 +0530, Steven wrote:

> 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.

--
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
http://www.big-discount-hosting.com
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

"Steven" <anonymous@.discussions.com> wrote in message
news:%23XNsJIRiEHA.3016@.tk2msftngp13.phx.gbl...
> 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.

0 comments:

Post a Comment