Pagination with $_POST and $_SESSION

Add the next lines of code to functions.php file within active theme to start session.

function example_login() {

    if ( ! session_id()) {
        session_start();
    }
}
add_action( 'init', 'example_login' );

and then Use $_SESSION to store the value of $post