Sorry second code should be
global $wp_query;
$post_id = $wp_query->post->ID;
$cookietime = time()+3600*24*365;
$lt = '|'
if (isset($_COOKIE['tst'])) {
$viewedstring = $_COOKIE['tst'];
$viewedstring .= $post_id.$lt;
setcookie('tst', $viewedstring, $cookietime, '/', '.domain.com');
}else{
$viewedstring = $post_id.$lt;
setcookie('tst', $viewedstring, $cookietime, '/', '.domain.com');
}
Problem in Firefox stays =(