Solved

ASP Cookie Expires on a specific date

Posted on 2004-10-11
3
287 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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

I have helped a lot of people on EE with their coding sources and have enjoyed near about every minute of it. Sometimes it can get a little tedious but it is always a challenge and the one thing that I always say is:  The Exchange of information …
I was asked about the differences between classic ASP and ASP.NET, so let me put them down here, for reference: Let's make the introductions... Classic ASP was launched by Microsoft in 1998 and dynamically generate web pages upon user interact…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

708 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now