How to do something for first time visitors only

I’m thinking I may have a need to do something for first time visitors only.

Perhaps just start off to at the top of the post have something like:

First time here? Check out our “Getting Started” Page

I want to put a cookie or something on someones computer so that that text will only show up to first time visitors (at least if they leave their cookies intact.)

What would be the syntax for that?

Yeah, you want to use a cookie. Depending on how informal your needs are, it doesn’t need to be much. For the case you’re discussing, you don’t even need to put anything in the cookie, just save a cookie on your visitor’s computer and then test for its existence. If the cookie exists, you know they’ve been to your site before. If they don’t have the cookie they are either first time visitors or they’ve cleared their cookies (but there’s no way to determine which). If you actually want to preserve some information, then you can use the cookie to save it. (I presume this is how sitepoint auto-authenticates you when you return after a few days. Even a session shouldn’t hold over that time frame). There are good tutorials at W3Schools and Quirksmode (both excellent web development sites to check out if you haven’t).

http://www.quirksmode.org/js/cookies.html