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 Andrzejek on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Logic setting a Cookie

Status
Not open for further replies.

timcadieux

Programmer
May 25, 2005
129
BE
Hi folkz, i'm just looking for some help in setting up a function to set a particular cookie.

Basically, I have alot of Flash on my pages, but i also have matching non-Flash content. What i wanted to do is if the system finds NO COOKIE, then set the cookie to yes to display Flash by Default. -Step 1

However, I then need to check the cookie from each page and see if the cookie does not exist, write it and set it to Yes but if it does exist and equals No, then do the appropriate code. - Step 2.

I want this to run on every page so i'd like a function I think.

Hope that's clear
 
This sounds like a good place to use an INCLUDE file.
 
ok, try this.
i'm not sure exactly what you mean, but this code should get you started on your cookie problem assuming you know nothing about cookies.
hopefully this helps you out a bit, you might need to get help from a more advanced user to actually implement other code.

response.Cookies ("whatever")
if Request.Cookies("whatever") = "" then
response.Cookies("whatever") = 1
'do more code here for the 'no cookie part'
else
'do other code when cookie found
end if


there are 10 people in this world. those who know binary, and those who don't.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top