Solved

ASP Cookie Expires on a specific date

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

I recently decide that I needed a way to make my pages scream on the net.   While searching around how I can accomplish this I stumbled across a great article that stated "minimize the server requests." I got to thinking, hey, I use more than one…
Have you ever needed to get an ASP script to wait for a while? I have, just to let something else happen. Or in my case, to allow other stuff to happen while I was murdering my MySQL database with an update. The Original Issue This was written…
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…

896 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

13 Experts available now in Live!

Get 1:1 Help Now