Run the following command in your project folder
composer require dotkernel/dot-flashmessenger
This will also install laminas/laminas-session as session handling is based on this library.
laminas/laminas-session