Remember currently logged in player

So I am developing a 2D gamified language learning platform. There will be leaderboards, scores etc. Currently, I am using mySQL to store all player details such as accounts and eventually scores etc. So far, I am using php scripts on my web server to access and manipulate the database (adding users, logging in etc).

I am wondering how would I go about storing player sessions. So in web development, you can use sessions and cookies to store information about a user as they navigate the website. How would I store say the player’s username so I can tailor the game to their account and progress (even when they go between scenes)

I thought perhaps playerprefs, but surely I would need to encrypt them so users can’t modify the details, would this be secure enough? is there a better way to go about doing this?

Thanks

I would continue with the method you’re using for data transfer. Have them “register” and make an accounts table in your database. Then, when they log in, assign them a session ID and pass that along with all other requests. Then your server code can cross-reference the ID with the account, and provide the proper data.