Solved

Set a cookie with ASP

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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
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…
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…

746 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

12 Experts available now in Live!

Get 1:1 Help Now