Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Cookies not being written

Status
Not open for further replies.

codefinger

Programmer
Feb 2, 2002
14
US
Objective: If the cookie exists for the username, fill in the user id name on the form on default.asp. Store the user name as a cookie when the form is submitted.

Please reference


for my code.

I know my cookies are turned on since I visit other websites, but for some reason, I can't get my site to store a simple username as a cookie.

Can anyone tell me what is wrong with my code?

I would be very grateful.

Thanks in advance.
 
gotta post the code that sets the cookie!!!!!!!!!! Bastien

There are many ways to skin this cat,
but it still tastes like chicken
 
<%@ Language=VBScript%>

<%

Response.Buffer = true

Response.Expires=0

Response.Cookies(&quot;userinfo&quot;)(&quot;username&quot;) = Request.Form.Item(&quot;textuserid&quot;)


%>


<html>
<head>
<META name=VI60_defaultClientScript content=VBScript>

<meta NAME=&quot;GENERATOR&quot; Content=&quot;Microsoft Visual Studio 6.0&quot;>

</head>



<body>

This is the director page...

<SCRIPT LANGUAGE=vbscript >
<!--

Dim radiovalue
Dim username
Dim usernumber
Dim passedstring

radiovalue = &quot;<%=Request.Form.Item(&quot;radionewcheck&quot;)%>&quot;
username = &quot;<%=Request.Form.Item(&quot;textuserid&quot;)%>&quot;
usernumber = &quot;<%=Request.Form.Item(&quot;textphoneno&quot;)%>&quot;



<% 'Response.Cookies(userinfo)(&quot;username&quot;) = username
Response.Redirect(Request.Form.Item(&quot;radionewcheck&quot;))%>





-->
</SCRIPT>


</body>
</html>
 
I think this should look like this
Response.Cookies(&quot;userinfo&quot;)(&quot;username&quot;) =
Request.Form(&quot;textuserid&quot;)

Actually all of your request should only read the
Request.Form excluding the &quot;.item&quot;
provide tools to let people become their best.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top