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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Really need help with cookies

Status
Not open for further replies.

mmarkym

Programmer
Mar 23, 2002
54
0
0
US
I've got a form with many checkboxes. The name for the form checkboxes is "menu"

In my ASP page I'm trying to set cookies and then test for their presence.

<%

dim iCount

I'm confused on the syntax of setting a cookie. specificaly the name for the cookie, response.cookie("this here"). I've chosen menu, the same name as the checkboxes but am not sure.

for iCount=1 to request.form("menu").count

--here i'm trying to set the cookies.--
response.cookies("menu") = request.form("menu")(iCount)

next

--and here I'm trying to retrieve cookies.--
for x=0 to uBound(request.cookies("menu"))
response.write "<br>" & x & " = " & request.cookies("menu")(x)
next %>
 
You are only writing one entry...

Try doing this...

Code:
<%
For iCount = 1 To Request.Form("menu").count
    Response.Cookies("menu" & iCount) = Request.Form("menu")(iCount)
Next

'Loop through each Cookie
For Each x in Request.Cookies
     Response.Write "<br>" & x & " = " & Request.Cookies(x)
Next
%>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top