-
ASP Cookies Login Twice Problem
Hi Everyone,
It seems that most of the time I have to login twice with the following login
page. I would appreciate very much anyone's suggestion or solution. Thank
you!
ac7117
<%
Const adModeReadWrite = 3
Dim Conn, rsUser, nEmpID, nUserName
If Len(Request.Form) > 0 then
Set Conn = Server.CreateObject("ADODB.Connection")
Conn.Mode = adModeReadWrite
Conn.Open Application("ApplBlaBla")
Set rsUser = server.CreateObject("ADODB.Recordset")
Conn.sp_Emp_login Request.Form("username"), Request.Form("password"), rsUser
If Not rsUser.EOF then
nEmpID = rsUser("employee_ID)
End If
If Ucase(nUserName) = Ucase(Request.Form("username")) then
With Response
.Cookies("I2B")("empid") = nEmpID
.Cookies("I2B")("Expires") = CDate("12/31/2001") '12/31/2001 is made
up
End With
'response.redirect to some page
else
'login error
End If
rsUser.Close: set rsUser = nothing
Conn.Close: Set Conn = nothing
%>
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks