When you want something to happen the first time someone visits certain pages on your site in a given session and then not happen again inf they revisit in the same session you need to set a first time cookie.
If you want to define alternate actions to be performed on odd and even numbered visits to a page you need a toggle action cookie.
A quick look at all of the different values that can be used to write cookies of different types and a function that you can use to make writing cookies of any type easier.
There's not much point in writing cookies if you can't read them back in. Here's a way to load all of the cookies on your site into an associative array where they are easier to access.
There is no actual delete command for deleting cookies once you have created them. Here's how to tell the browser to ignore the cookie which is effectively the same thing.