Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 111023
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T02:19:09+00:00 2026-05-11T02:19:09+00:00

I have a script that reads a form and puts some info into a

  • 0

I have a script that reads a form and puts some info into a cookie:

Dim oCookie as HttpCookie oCookie = New HttpCookie('authInfo') Select Case oResult Case 'No ClientID', 'No Password', 'No PracType', 'No Encrypt', 'CRC Mismatch'     oCookie.Values.Add('LoggedIn', 'False')     oCookie.Values.Add('OnSupport', 'False') Case 'Client Can Update'     oCookie.Values.Add('LoggedIn', 'True')     oCookie.Values.Add('OnSupport', 'True') Case 'Client Cannot Update'     oCookie.Values.Add('LoggedIn', 'True')     oCookie.Values.Add('OnSupport', 'False') End Select oCookie.Expires = DateTime.Now.AddHours(2) HttpContext.Current.Response.Cookies.Add(oCookie) HttpContext.Current.Response.Redirect('default.aspx') 

The time is properly set right before it redirects, but when I try to print out that value this way (I have also tried Dim oCol as HttpCookieCollection = Request.Cookies, but I get the same result):

Response.Output.WriteLine(Request.Cookies('authInfo').Expires.ToString) 

The time is always reset '01/01/0001 12:00:00 AM'. Am I missing something that prevents the cookie from holding its Expires value?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-11T02:19:10+00:00Added an answer on May 11, 2026 at 2:19 am

    Request.Cookies and Response.Cookies and use of the common cookie object makes of an intuative idiom but in fact a Request cookie and a Response cooke are quite different.

    When you assign a Cookie in the response a Set-Cookie header gets added to the output and that will contain not only the value but also the path and the expiries value.

    However when the browser sends the cookie back to the server in another request it simply includes the cookie name and value. It does not send path or expires info.

    Hence these properties are meaningless when using the Request.Cookies collection.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a script (worker.py) that prints unbuffered output in the form... 1 2
I have a php script that handles a form input. For design reasons both
I have a script that appends some rows to a table. One of the
I have a script that parses the filenames of TV episodes (show.name.s01e02.avi for example),
I have a script that retrieves objects from a remote server through an Ajax
I have a script that checks responses from HTTP servers using the PEAR HTTP
I have a script that takes a table name and generates a control file
I have a script that renders graphs in gnuplot. The graphs all end up
I have a script that works fine on my test server (using IIS6). The
I have a script that successfully encrypts a credit card. I need it to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.