Solved

Set a cookie with ASP

Posted on 1998-11-18
2
152 Views
Last Modified: 2010-05-03
I need code that can set a cookie that will stay if the user is using Netscape or MSIE.
0
Comment
Question by:jfl
2 Comments
 

Accepted Solution

by:
MrOBrian earned 20 total points
ID: 1445391
How to set a cookie:

Response.Cookie("mycookie") = "this is the text..."
Response.Cookie("mycookie").Expires = "January 1, 1999"

Pulling this right out of a book...  You should be able to set the Expiration date to whatever you want, assuming y2k compliance.  "mycookie" can be changed to whatever variable you want to save it as, the first line can only contain text, and I think that the expiration date has to be in the above format...
Another way to do cookies with ASP is with server variables, but they expire when the session ends.  If you don't use session variables (this is something I didn't know...) you can put in:
<%@ EnableSessionState=False %>
as the first line of your ASP code to get a performance boost.
0
 

Author Comment

by:jfl
ID: 1445392
I can not make it work in both IE and Netscape. Can you?
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

792 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