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

about asp cookies question thanks

Status
Not open for further replies.

melnet

Programmer
Jul 8, 2003
77
HK
hi

Response.Cookies(CName)(CKey) = CValue

what meaning??

i just understand Response.Cookies(CName) = CValue

but now has two (CName)(Ckey)

thnaks
 
Hi there melnet,

Response.Cookies(CName)(CKey) = CValue

means you can have many values in the same cookie

Response.Cookies("yourcookie")("value1") = "value 1"
Response.Cookies("yourcookie")("value2") = "value 2"

so here the CName is "yourcookie" the CKey is "value1" and "value2" and the values are there for you.

to find out if your cookie has any keys at all:

<%=Response.Cookies("yourcookie").HasKeys%>

This will return either true or false.

Hope this is ok for you.
 
in your case,
Response.Cookies("yourcookie")("value1") = "value 1"

"yourcookie" and "value1" have "value1", right!?

thanks
 
Response.Cookies("yourcookie")("value1") = "value 1"
Response.Cookies("yourcookie")("value2") = "value 2"

hum... let me explain first. ~.~;

yourcookie has a key called value1.
yourcookie have no any value,
if i wanna get value 1, i code Request.Cookies(x)(y), right?

it's look like yourcookie.value1="value 1"?!!

thanks
 
to get value one you use

<%=request.cookies("yourcookie")("value1")%>

response.cookies sets the cookie
request.cookies gets the value from the cookie.

so yeh :eek:)
 
i understand how to use response.cookies and equest.cookies.

but i stil dont understand sth...

for example

CName=john
CValue=10

1.Response.Cookies(CName) = CValue

2.Response.Cookies(CName)(CKey) = CValue

in case 1., CName is equal to john or 10?

in case 2., what value of CName and Ckey!?
are CName and CKey 10?
or CName=john, Cvalue=10?????
or CName is empty and CKey is 10???

thanks....
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top