Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

COOKIES

Status
Not open for further replies.

ShawnDT

Technical User
May 1, 2006
67
US
Good Afternoon,

Can someone tell me why Internet sites are able to write cookies to my machine and not Intranet site?
 
The server can really only suggest that a browser accept a cookie... so check your browser's settings.

Also be aware that the browser may have different behavior for session cookies and persistent cookies. Also you might find a clue if IE and Firefox do not have the same cookie behavior.
 
thanks for your speedy reply.

I am try to add data to a cookie. I am able to add the data. But I cannot update. When the cookie is created, I can submit a form object and it adds the value. The next time I go to the page. The cookie is there but the value information is gone. How do I prevent that from happening? Also I want to be able to add multiple things to this particular cookie file. So for instance, I have a search field. The Value is searched for and stored in the cookie. If that is not what I want I can search again and that value you just searched is added also. Right now if I try that with my code the first value is delete. I will add the code below

<CODE>
<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "<% Response.buffer = True
name = Request.Form("name")
Response.Cookies("name") = name
Response.Cookies("name").Expires=DateAdd("m", 2, Now())
%>
<html xmlns="<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
<style type="text/css">
<!--
.style1 {color: #3333FF}
-->
</style>
</head>

<body>
<form action="oreo.asp" method="post">
Name: <input type="text" name="name" size="20">
<input type="submit" value="submit"><BR />
<BR />

<span class="style1">Your last searched items</span><BR />


<%

' first we retrive the data and set it to a variable
name = Request.Cookies("name")
' then we post it to the website
Response.Write (name)

%>

</body>
</html>
<CODE>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top