How to set a flag at node when user view node?
Using the Rules module seems like a no brainer to me to get this to work, with no custom module(s) needed ...

Here is how your custom rule should look like (a kind of getting started with Rules):


Rules Event: When viewing content.
Rules Condition: Check the content type that matches your needs.
Rules Action: Flag the node being viewed by the current user.


Ps: I'm assuming this is about D7.