Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Cookie's Expiration property unexpectedly changing

Reply
Thread Tools

Cookie's Expiration property unexpectedly changing

 
 
Jeff Bowman
Guest
Posts: n/a
 
      07-14-2005
Here's the code:

Private Sub SetCookie(ByVal tcEmail As String)
Dim loCookie As New HttpCookie("Email")
loCookie.Value = Utils.StringToBase64(tcEmail)
loCookie.Expires = Now.AddYears(10)
Response.Cookies.Add(loCookie)
End Sub

The cookie appears to accept the specified expiration date (i.e. #7/13/2015
10:18:21 PM#) just fine, but when I read the cookie in a new browser session its
Expiration property returns simply #12:00:00 AM#.

What happened to the date portion, and more importantly how can I get it back? I
need it so I can do calculations elsewhere in my code.

Many TIA for any suggestions,
Jeff



 
Reply With Quote
 
 
 
 
Jeff Bowman
Guest
Posts: n/a
 
      07-14-2005
OK, after a bit of a break to step away and clear my head a bit, I've concluded
that the value of a cookie's Expiration property isn't intended to be used in
any sort of server-side computation--it's for the browser's internal use only.

Armed with this new way of looking at things, I only had to change the way I was
doing my calculation. All is well now, and I can go to bed and rest peacefully.

Thanks for your ear!

Jeff



Jeff Bowman wrote:
> Here's the code:
>
> Private Sub SetCookie(ByVal tcEmail As String)
> Dim loCookie As New HttpCookie("Email")
> loCookie.Value = Utils.StringToBase64(tcEmail)
> loCookie.Expires = Now.AddYears(10)
> Response.Cookies.Add(loCookie)
> End Sub
>
> The cookie appears to accept the specified expiration date (i.e. #7/13/2015
> 10:18:21 PM#) just fine, but when I read the cookie in a new browser session
> its Expiration property returns simply #12:00:00 AM#.
>
> What happened to the date portion, and more importantly how can I get it
> back? I need it so I can do calculations elsewhere in my code.
>
> Many TIA for any suggestions,
> Jeff



 
Reply With Quote
 
 
 
 
Robert Smith
Guest
Posts: n/a
 
      07-16-2005

The cookie appears to accept the specified expiration date (i.e. #7/13/2015
10:18:21 PM#) just fine, but when I read the cookie in a new browser session
its
Expiration property returns simply #12:00:00 AM#.

What happened to the date portion, and more importantly how can I get it
back? I
need it so I can do calculations elsewhere in my code.

Many TIA for any suggestions,





"Jeff Bowman" <> wrote in message
news:%239HUf%...
> Here's the code:
>
> Private Sub SetCookie(ByVal tcEmail As String)
> Dim loCookie As New HttpCookie("Email")
> loCookie.Value = Utils.StringToBase64(tcEmail)
> loCookie.Expires = Now.AddYears(10)
> Response.Cookies.Add(loCookie)
> End Sub
>
> The cookie appears to accept the specified expiration date (i.e.

#7/13/2015
> 10:18:21 PM#) just fine, but when I read the cookie in a new browser

session its
> Expiration property returns simply #12:00:00 AM#.
>
> What happened to the date portion, and more importantly how can I get it

back? I
> need it so I can do calculations elsewhere in my code.
>
> Many TIA for any suggestions,
> Jeff
>
>
>




__________________________________________________ _____________________________
Posted Via Uncensored-News.Com - Accounts Starting At $6.95 - http://www.uncensored-news.com
<><><><><><><> The Worlds Uncensored News Source <><><><><><><><>

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
VPN client unexpectedly disconnects Alexis Crawford Cisco 1 11-04-2004 11:39 PM
shell stopped unexpectedly =?Utf-8?B?dmVyYQ==?= Microsoft Certification 1 05-06-2004 10:13 PM
"perl -MCPAN -e shell" acts unexpectedly on MacOS X 10.3.1 Art Werschulz Perl 0 12-03-2003 02:17 AM
Stopping VS.NET Debugger causes aspnet_wp to stop unexpectedly Keith ASP .Net 0 08-19-2003 03:56 PM
aspnet_wp.exe stopped unexpectedly Dave Stockton ASP .Net 0 07-09-2003 04:59 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57