Cookies virker ikke
Hej eksperter,Hvorfor fungerer mine cookies ikke?
_________________________________________________
<%
response.write("<table width='630' align='center' cellpadding='3' cellspacing='0' class='textnavigation'>")
response.write("<tr>")
response.write("<td>Communications</td>")
response.write("</tr>")
response.write("</table>")
response.write("<br>")
'Åbner databasen
set conn = opendb()
strMode = Request.QueryString("mode")
select CASE strMode
CASE "addmessage"
author = request.cookies("nick")
email = request.cookies("email")
if request.form("mode") = "insert" then
topic = replace(Trim(request.form("topic")),"'","''")
body = replace(Trim(request.form("body")),"'","''")
bodyStr = replace(body,vbcrlf,"<br>")
author = Trim(request.form("nick"))
email = Trim(request.form("email"))
website = Trim(request.form("website"))
ierr = 0
if author = "" then
ierr = 1
errormsg = errormsg + "<br><li>Du skal skrive et navn</li>"
end if
if topic = "" then
ierr = 1
errormsg = errormsg + "<br><li>Du skal skrive en overskrift</li>"
end if
if body = "" then
ierr = 1
errormsg = errormsg + "<br><li>Du skal skrive en besked</li>"
end if
'Udskriver fejlene
response.write("<table width='630' align='center' cellpadding='5' cellspacing='5' class='texterror'>")
response.write("<td colspan='2'> " & "Følgende fejl opstod:" & errormsg & "</font><br></td>")
response.write("</table>")
if ierr = 0 then
SQL = "insert into communications(author, email, website, topic, body, ip) values('"
SQL = SQL & author & "','"
SQL = SQL & email & "','"
SQL = SQL & website & "','"
SQL = SQL & topic & "','"
SQL = SQL & bodyStr & "','"
SQL = SQL & Request.ServerVariables("REMOTE_ADDR") & "')"
set RSinsert = conn.Execute(SQL)
if request.form("remember") = "true" then
Response.cookies("nick") = author
Response.Cookies("nick").Expires = Date+365
Response.cookies("email") = email
Response.Cookies("email").Expires = Date+365
end if
response.redirect("default.asp")
end if
end if
response.write("<form name='form1' method='post' action='default.asp?mode=addmessage'><input type='hidden' name='mode' value='insert'>")
response.write("<table width='630' align='center' cellpadding='3' cellspacing='0' class='textnormal'>")
response.write("<tr>")
response.write("</tr>")
response.write("<tr>")
response.write("<td width='153'>Navn: * </td>")
response.write("<td width='455'><input name='nick' type='text' id='nick' value='" & author & "' class='textfields' size='86'></td>")
response.write("</tr>")
response.write("<tr>")
response.write("<td>E-mail: *</td>")
response.write("<td width='455'><input name='email' type='text' class='textfields' id='email' value='" & email & "' size='86'></td>")
response.write("</tr>")
response.write("<tr>")
response.write(" <td>Website:</td>")
response.write("<td height='24' width='455' valign='top'><input name='website' type='text' class='textfields' id='website' value='" & website & "' size='86'></td>")
response.write("</tr>")
response.write("<tr>")
response.write(" <td height='24'>Overskift: *</td>")
response.write("<td valign='bottom'><input name='topic' type='text' class='textfields' id='topic' value='" & topic & "' size='86'></td>")
response.write("</tr>")
response.write("<tr>")
response.write("<td valign='top'>Besked: *</td>")
response.write("<td width='455' valign='top' class='textsmall'>")
response.write("<textarea name='body' cols='86' class='textareas' onselect='storeCaret(this);' onchange='storeCaret(this);countLetters(this);' onclick='storeCaret(this);' onkeydown='storeCaret(this);countLetters(this);' onkeyup='storeCaret(this);countLetters(this);'>"& body &"</textarea>")
response.write("<br>")
response.write("Din besked må maksimalt være på 700 tegn - du har <span id='lettercount'>700</span> tegn tilbage.")
response.write("<br>")
response.write("<td width='2'></td>")
response.write("</tr>")
response.write("<tr>")
response.write("<td height='36' valign='top'>Husk mine informationer:<br>")
response.write("<font color ='cccccc'>(Ved brug af Cookies)</font></td>")
response.write("<td height='40' valign='top'><input name='remember' type='checkbox' class='checkbox' id='remember' value='checkbox'></td>")
response.write("</tr>")
response.write("<tr>")
response.write("<td></td>")
response.write("<td><input name='Submit' type='submit' class='submitfield' value='Opret beskeden'></td>")
response.write("</tr>")
response.write("<tr>")
response.write("<td height='40' valign='bottom'> »<a href='default.asp'> Tilbage til Communications</a></td>")
response.write("<td></td>")
response.write("</tr>")
response.write("</table>")
response.write("</form>")
%>