I need a way to identify the same person that visits my webpage.... Until now i used cookies and the code is the following.
if ( $ENV{HTTP_COOKIE} ) { $st = $db->prepare( 'SELECT * FROM logs' ); $st->execute(); while ( $row = $st->fetchrow_hashref ) { if ( cookie(host) eq $row->{host} ) { $db->do( "UPDATE logs SET visits=visits+1 WHERE host='$row->{ +host}'" ) or die $db->errstr; } } if ( not $st->rows() ) { $db->do( "INSERT INTO logs VALUES (NULL, '$host', '$xronos', 'in +dex', 1)" ) or die $db->errstr; } } elsif ( !$ENV{HTTP_COOKIE} ) { $db->do( "INSERT INTO logs VALUES (NULL, '$host', '$xronos', 'index +', 1)" ) or die $db->errstr; }
Well this piece of code worked great until i realized that not all of the website visitors had their broswer ebabled to store cookies. Because of that my website inserted 10-20 records of the same person that vistied my website because when the page wanted to read the visitors cookie it could not do it because the cookie never actually stored to the visitors pc. So the code decided to insert this person ip at the log onece again and once again thinking that he was another visitor.

Is there a way to overcome these obstacle? Can it be done by mainting state information on server side ? I did try to do read about this butdid not quite understand if this is the thing to what i want to do.....

Please if it is possible, can you give me an example of how can this be done please? To see what exactly happened to my webpage now go to http://www.nikolas.tk and at the first text box thats ask for a neme in (greek) type showlog and then click the button (emfanisi olos ton apospson) to see that it has logged you. But if you vitid again the site in wont say 2 (unless you have cookies anabled bu instead i will insrt anothe line of you)

I hope i gave you to understand what the problem was. Please give me examples if it can overcome this obstacle in another way.... Thank you.
The Devil Is In The Details!

In reply to Need a way to identify the same person that visits my webpage. by Nik

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.