PDA

View Full Version : Cookies to temporarily recognize...



Mrs McLaren
11-27-2003, 04:32 AM
Hi all :D

I need your help with this problem I have (well it's not really a problem but...)

I'm finishing up my new website that has two different versions and two index pages leading to each version. Even though both indexes can be accessed at the beginning of the site and each index page is linked to the other through the whole site.... I decided to use a hits counter that will appear on both indexes.

Now here's the big idea :D

I want the site to somehow temporarily recognize each user (without registration/membership or stuff like that) so when the user is on one version of the site and somehow decides to visit the other version the counter should somehow know that the user already visited the first index and so the visitor number will remain the same and the user won't be recounted untill he leaves the site and comes back again later :)

So could you guys help me out on this? :) I have no idea how to do this.

Chris
11-27-2003, 07:25 AM
It depends entirely on how your stat program works and what kind of technologies you're using on your site (php, javascript, just straight html).

http://www.websitepublisher.net/article/php_cookies/

That article may be able to help you.

Mrs McLaren
11-27-2003, 08:36 AM
Thanks but I ve already read your article :)

I'm using HTML and PHP on my site and the buttons and intro are made with flash 5 :)

The counter is made with PHP language by a friend of mine :)

At the moment I set two different counters to just count for each version and of the site :)

Chris
11-27-2003, 08:44 AM
So use php to write a cookie indicating the site the person first visits.

Then on every page view compare the current site with whatever is in the user's cookie and you'll know if he just jumped over or not. If he did you can make the appropriate changes to your hit counter.

lo0ol
11-27-2003, 09:17 AM
That's a great article for background info about cookies, Chris. Nice work.