Print Page | Close Window

Cookie problem

Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: ASP.NET Discussion
Forum Description: Discussion and chat on ASP.NET related topics.
URL: https://forums.webwiz.net/forum_posts.asp?TID=7156
Printed Date: 28 March 2026 at 9:08am
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: Cookie problem
Posted By: Boecky
Subject: Cookie problem
Date Posted: 11 November 2003 at 6:30am
I'm sorry if this is already asked before, but I have a problem with using cookies. When I have the following code:

Response.Cookies("boeckytest")("id") = "1"
Dim id As Integer
id = CInt(Request.Cookies("boeckytest")("id"))

The id has 1 as value, but the cookie is not in my cookie dir on my hard drive...that means, I can use the cookie as long as my browser is open. What am I doing wrong? How can I write a real cookie?



Replies:
Posted By: MorningZ
Date Posted: 11 November 2003 at 8:26am

you need to set the "Expires" property so the cookie doesn't expire right away (whgen browser is closed)

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfSystemWebHttpRequestClasscookiesTopic.asp - MSDN Help page about the Response.Cookies stuff



-------------
Contribute to the working anarchy we fondly call the Internet


Posted By: Diep-Vriezer
Date Posted: 11 November 2003 at 8:48am
 Yup, I asked the same question before. Infact, it was my first post on WWF

-------------
Gone..


Posted By: Boecky
Date Posted: 11 November 2003 at 9:20am
Great! It's working



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net