Add logged_in sessions check and view posts functionality