Restrict unregistered users to limited number of page views

Thanks. I thought of using cookies though I have no much idea about it.