Solved

ASP Cookie Expires on a specific date

Posted on 2004-10-11
3
291 Views
Last Modified: 2008-01-09
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.
0
Comment
Question by:rudyflyer
  • 3
3 Comments
 

Accepted Solution

by:
WebJoe earned 100 total points
ID: 12285975
' --- 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
 

Expert Comment

by:WebJoe
ID: 12563274
Sorry about the typo in line 5, it should read

dtDateEnd = CDate(objRecordset.Fields("DateEnd").Value)
0
 

Expert Comment

by:WebJoe
ID: 12567755
Thank you for the grade, rudyflyer
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
age from date of birth 4 57
Weighted Randomizing 6 32
Debugging Html 8 31
Two decimal 5 25
Hello, all! I just recently started using Microsoft's IIS 7.5 within Windows 7, as I just downloaded and installed the 90 day trial of Windows 7. (Got to love Microsoft for allowing 90 days) The main reason for downloading and testing Windows 7 is t…
I would like to start this tip/trick by saying Thank You, to all who said that this could not be done, as it forced me to make sure that it could be accomplished. :) To start, I want to make sure everyone understands the importance of utilizing p…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question