Solved

Set a cookie with ASP

Posted on 1998-11-18
2
154 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Revamp Your Training Process

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action.

Question has a verified solution.

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

Suggested Solutions

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…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
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…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

751 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