My web application uses sessions to store information about the user once they\'ve logged in, and to maintain that information as they travel from page to page within the ap
I think you could just do this:
$cookieString = password_hash($username, PASSWORD_DEFAULT);
Store $cookiestring in the DB and and set it as a cookie. Also set the username of the person as a cookie. The whole point of a hash is that it can't be reverse-engineered.
When a user turns up, get the username from one cookie, than $cookieString from another. If $cookieString matches the one stored in the DB, then the user is authenticated. As password_hash uses a different salt each time, it is irrelevant as to what the clear text is.