quick cookie questions

Y

YT

Couple of quick ASP (3.0) Cookie questions:

1/ I'm using a cookie in my asp script to place cookies (within a key) so my code looks like:
Response.Cookies( "quoteform" )( "name" ) = Session( "name" )
Response.Cookies( "quoteform" )( "organization" ) = Session( "organization" )
Response.Cookies( "quoteform" )( "address1" ) = Session( "address" )
Response.Cookies( "quoteform" )( "address2" ) = Session( "suite" )
Response.Cookies( "quoteform" )( "city" ) = Session( "city" )
Response.Cookies( "quoteform" )( "provstate" ) = Session( "provstate" )
Response.Cookies( "quoteform" )( "postzip" ) = Session( "postzip" )
Response.Cookies( "quoteform" )( "email" ) = Session( "email" )
Response.Cookies( "quoteform" )( "phone" ) = Session( "phone" )
Response.Cookies( "quoteform" )( "fax" ) = Session( "fax" )

Can i set the expires property to this entire key? Like so:
Response.Cookies( "quoteform" ).Expires = DateAdd( "m", 1, Now )
Or do i have to set the expires property for each cookie above?

2/ Is there a really quick way of removing all of the above cookies? or do i have to do something like:
Response.Cookies( "quoteform" )( "name" ) = ""
Response.Cookies( "quoteform" )("name").Expires = DateAdd( "d", -1, Now )


Thanks!
yt
 
W

William Morris

Someone will probably come along and correct me on this, but I belive the
only way to set expires on a cookie like that is Response.Cookies(
"quoteform" ).expires = ... since ( "name" ) for instance isn't the name of
the cookie, only a subkey in it.

What you've actually got is ONE cookie, "quoteform", with lots of subkeys.
You remove it by setting it's expires property to date - 1.


--
William Morris
Product Development, Seritas LLC
Kansas City, Missouri


Couple of quick ASP (3.0) Cookie questions:

1/ I'm using a cookie in my asp script to place cookies (within a key) so my
code looks like:
Response.Cookies( "quoteform" )( "name" ) = Session( "name" )
Response.Cookies( "quoteform" )( "organization" ) = Session(
"organization" )
Response.Cookies( "quoteform" )( "address1" ) = Session( "address" )
Response.Cookies( "quoteform" )( "address2" ) = Session( "suite" )
Response.Cookies( "quoteform" )( "city" ) = Session( "city" )
Response.Cookies( "quoteform" )( "provstate" ) = Session(
"provstate" )
Response.Cookies( "quoteform" )( "postzip" ) = Session( "postzip" )
Response.Cookies( "quoteform" )( "email" ) = Session( "email" )
Response.Cookies( "quoteform" )( "phone" ) = Session( "phone" )
Response.Cookies( "quoteform" )( "fax" ) = Session( "fax" )

Can i set the expires property to this entire key? Like so:
Response.Cookies( "quoteform" ).Expires = DateAdd( "m", 1, Now )
Or do i have to set the expires property for each cookie above?

2/ Is there a really quick way of removing all of the above cookies? or do i
have to do something like:
Response.Cookies( "quoteform" )( "name" ) = ""
Response.Cookies( "quoteform" )("name").Expires = DateAdd( "d", -1,
Now )


Thanks!
yt
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,770
Messages
2,569,583
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top