I've seen this pattern used in a considerable amount of MVC applications. Let's assume we have a User model with the methods:
The first method (hasSessionExpired) looks up in the database if the user's session has expired and returns true or false and the second calls the first method and returns an HTML string that basically says "Expired" with a red font or "Active" with a green font depending on the output of hasSessionExpired.
In the controller there is a call to the User object to fetch all users which are returned as an array of User objects, this array is sent to the view.
Then in the view, the array is iterated and the method displaySessionExpired is called for every object in the array.
There is something that smells fundamentally wrong with this approach, since the model has presentation logic in the displaySessionExpired method and the outcome of that logic is based on the outcome of a database query made at that moment. This of course makes the model classes have thousands of lines plagued with mixes of presentation and business logic that in the long run makes the application more difficult to maintain.
How should this be refactored so there is a clear separation of concerns?