Hi
I have a login script that has 2 profiles
a test profile
and my own profile
The meaning of this is that I can use both profiles
and that everytime i change profile a new cookie
is created on my pc and the old one overwritten...
BUT that does not happen now even though et logs
me in all right ?
How come ?
Thanks so much for this great forum
iceb
The code:
formular.asp
<%
if Request.ServerVariables("REQUEST_METHOD"
= "POST" then
' Databaseforbindelse - husk at angive sti til din database
Set Conn = Server.CreateObject("ADODB.Connection"
DSN = "DRIVER={Microsoft Access Driver (*.mdb)}; "
DSN = DSN & "DBQ=" & Server.MapPath("/db/hp.mdb"
Conn.Open DSN
Set rs = Server.CreateObject("ADODB.RecordSet"
username = replace(Request.Form("username"
,"'",""
password = replace(Request.Form("password"
,"'",""
strSQL= "SELECT * FROM medlemmer WHERE (brugernavn= '" & username & "' AND kode='" & password & "') AND (status = 1 OR status = 2)"
Set rs = Conn.Execute (strSQL)
if not rs.EOF then
session("loginOK"
= "naturligvis"
session("loginMemberID"
= rs("ID"
response.cookies("forumData"
("brugerID"
= Session("loginMemberID"
response.cookies("forumData"
.Expires = now + 365
Conn.Close
'Den side man skal til når man er logget ind
Response.Redirect("dokument.asp"
else
session("loginOK"
= ""
session("loginMemberID"
= ""
if not rs.EOF then
session("loginOK"
= "naturligvis"
session("loginMemberID"
= rs("memberID"
response.cookies("forumData"
("brugerID"
= Session("loginMemberID"
response.cookies("forumData"
.Expires = now + 365
Conn.Close
'Den side man skal til når man er logget ind
else
Response.Redirect("til.asp"
session("loginOK"
= ""
session("loginMemberID"
= ""
response.cookies("forumData"
("brugerID"
= ""
end if
end if
end if
%>
<html>
<head></head>
<body bgcolor="#999966" text="#000000" link="#000000" vlink="#000000" alink="#FFFFFF">
<center><p>Velkommen til login her:</p>
Tilmeld dig <a href=" target="_blank"> her</a>
<table border="1">
<form method="post" action="formular.asp">
<tr><td>Brugernavn:</td><td><input name="username"></td></tr>
<tr><td>Kode:</td><td><input type="password" name="password"></td></tr>
<tr><td colspan="2" align="center"><input type="submit" value="Login" name="Action">
</td></tr>
</form></table>
<%
response.write request.cookies("forumData"
("brugerID"
%>
For tests only user: ice pass: ic
</center>
</body>
</html>
I have a login script that has 2 profiles
a test profile
and my own profile
The meaning of this is that I can use both profiles
and that everytime i change profile a new cookie
is created on my pc and the old one overwritten...
BUT that does not happen now even though et logs
me in all right ?
How come ?
Thanks so much for this great forum
iceb
The code:
formular.asp
<%
if Request.ServerVariables("REQUEST_METHOD"
' Databaseforbindelse - husk at angive sti til din database
Set Conn = Server.CreateObject("ADODB.Connection"
DSN = "DRIVER={Microsoft Access Driver (*.mdb)}; "
DSN = DSN & "DBQ=" & Server.MapPath("/db/hp.mdb"
Conn.Open DSN
Set rs = Server.CreateObject("ADODB.RecordSet"
username = replace(Request.Form("username"
password = replace(Request.Form("password"
strSQL= "SELECT * FROM medlemmer WHERE (brugernavn= '" & username & "' AND kode='" & password & "') AND (status = 1 OR status = 2)"
Set rs = Conn.Execute (strSQL)
if not rs.EOF then
session("loginOK"
session("loginMemberID"
response.cookies("forumData"
response.cookies("forumData"
Conn.Close
'Den side man skal til når man er logget ind
Response.Redirect("dokument.asp"
else
session("loginOK"
session("loginMemberID"
if not rs.EOF then
session("loginOK"
session("loginMemberID"
response.cookies("forumData"
response.cookies("forumData"
Conn.Close
'Den side man skal til når man er logget ind
else
Response.Redirect("til.asp"
session("loginOK"
session("loginMemberID"
response.cookies("forumData"
end if
end if
end if
%>
<html>
<head></head>
<body bgcolor="#999966" text="#000000" link="#000000" vlink="#000000" alink="#FFFFFF">
<center><p>Velkommen til login her:</p>
Tilmeld dig <a href=" target="_blank"> her</a>
<table border="1">
<form method="post" action="formular.asp">
<tr><td>Brugernavn:</td><td><input name="username"></td></tr>
<tr><td>Kode:</td><td><input type="password" name="password"></td></tr>
<tr><td colspan="2" align="center"><input type="submit" value="Login" name="Action">
</td></tr>
</form></table>
<%
response.write request.cookies("forumData"
%>
For tests only user: ice pass: ic
</center>
</body>
</html>