ASP Cookie Expires on a specific date

Hello,

I have a database that has a column called "DateEnd" with a type of datetime.  So, for example, there is a value in there that is "10/12/2004".  So, how can I make a cookie expire one day after the value in DateEnd?

Thanks in advance.
rudyflyerAsked:
Who is Participating?
 
WebJoeConnect With a Mentor Commented:
' --- variable for example
Dim dtDateEnd

' ---your code to get the date from the database, add the following:
dtDateEnd = CDate(objRecordset.Fields("DateEnd").Value=

' --- finish DB code

' --- set cookie
Response.Cookies.Expires = DateAdd("d", 1, dtDateEnd)
0
 
WebJoeCommented:
Sorry about the typo in line 5, it should read

dtDateEnd = CDate(objRecordset.Fields("DateEnd").Value)
0
 
WebJoeCommented:
Thank you for the grade, rudyflyer
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.