Forums

This topic is locked

Stumped like a tree

Posted 28 Aug 2002 05:14:18
1
has voted
28 Aug 2002 05:14:18 aegis kleais posted:
I've made a custom login script that works fine (UD checks the username and password and logs them in) However, some select people, when they submit the form are returned to the same page, but with the fields now blank (where username and password go) I've done tests and their browsers do hold session variables, they're not behind firewalls or what not.

So, I'm making a beta page they can goto where they can supply the username and password in the URL.

here's the code I have so far:

<%
if (Request.QueryString("username" <> "" and (Request.QueryString("password" <> "" Then
'set variables
un = Request.QueryString("username"
pw = Request.QueryString("password"
access = false

'check for valid users
if (CStr(un) = "aegis" and (CStr(pw) = "kleais" then
access = true
Session("MM_Username" = "aegis"
end if

if (access = true) then
Response.Redirect("index.asp"
end if
End If
%>

Sure enough when I enter login_beta.asp?username=aegis&password=kleais

I am sent to index.asp. Now, for some reason, this code on index.asp keeps sending me back to the login.asp page:

un = Session("MM_Username"
if un = "" then Response.Redirect("login.asp"

if Request.Cookies("masterCookie"("remember" = "yes" then
Response.Cookies("masterCookie".expires = Date + 30
Response.Cookies("masterCookie"("uname" = (rcdLoggedInUser.Fields.Item("fldUsername".Value)
Response.Cookies("masterCookie"("pword" = (rcdLoggedInUser.Fields.Item("fldPassword".Value)
end if

For some reason, when I set Session("MM_Username" on the login_beta.asp page, the index.asp page no longer picks that up and sends me back to the login page. (the first, non-beta, login page). What's the dealy-o?

The indexpage creates a records set from a table dbo.Users where fldUsername = Session("MM_Username" So it should pick aegis' record.

Aegis Kleais
New Media Web Developer
(DWMX : IIS5.1 : SQL2K : WXP : ASP[VB/JS])

Reply to this topic