Solved

Set a cookie with ASP

Posted on 1998-11-18
2
150 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

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

Suggested Solutions

Title # Comments Views Activity
VB 6.0 printer how to align 6 58
A macro to Count the number of rows across all worksheets 3 84
Add and format columns in vb6 7 47
Passing a Text Box name to a Sub 6 80
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
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…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

863 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

22 Experts available now in Live!

Get 1:1 Help Now