How to save history in the client’s browser without login? [closed]

You can use cookie to store information in the visitor’s browser.

In your single post template, you can set the cookie by using

setcookie( 'last_post_id', get_the_ID() );

And on your other page, you can manage the last post that the user has visited.

$last_post_id = ! empty( $_COOKIE['last_post_id'] ) ? $_COOKIE['last_post_id'] : false;
if( $last_post_id ) {
 // do something with the cookie.
}