“查看”系统 - 每个用户一次

I need to implement "viewed" system.

How it can be done, so that pressing F5 would not increase viewed number for more than 1 per user?

SO also has such system.

Cookies, sessions, db? How it is usually done?

You will need a combination of technologies here. Each user needs to be identified uniquely (using sessions, cookies, whatever works best in your scenario). From there, you will need to be maintaining a database of hits for an item with the user's unique key (stored in their cookie or session or whatever).

When the user accesses the page, check the database to see if that user's unique key already has a hit on that page. If not, add it. Regardless, once done, pull the total number of hits that the item has had from the database. Tahdah.

Just store in your database user_id, resource_id (eventually timestamp) and before you increase viewed value check whether SQL like this:

SELECT COUNT(*) FROM ... WHERE user_id = ? AND resource_id = ? (AND timestamp > NOW() - 7 DAYS or sth)

doesn't return 1.

This depends a lot on the situation. For example, if each user is logged in with a user ID, it would be very different then if you are doing a splash page where users are not expected to be logged in.

I will assume you are in the latter category, and that users are not logged in to your page. If this were the case, I would recommend setting a cookie using the setcookie command, this could be accomplished like this:

if (empty($_COOKIE['hasViewed'])) {
    //increment the total number of views in the
    //database or wherever we are storing it.
    $viewer->incrementViews();
}
//make sure they have a cookie for next time
setcookie("hasViewed", "1", time() + 60*60*24*30);

Note that in this example, the user would be able to cause your view to increment again if they haven't seen the page in 30 days.