By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
448,682 Members | 1,007 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 448,682 IT Pros & Developers. It's quick & easy.

quick cookie questions

P: n/a
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

Jul 19 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
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
"YT" <yt******@MAPSONfunkychickens.org> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
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
Jul 19 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.