What is the best way to carry users data through the pages(php)? Currently, I use sessions to hold and use data like username, lastlogin, password, purchased items and … between the website pages.
Would saving these data in sessions decrease security of website? Is there another way(s) to carry these data?
Save the persistent data (which need to be preserved even if user closes the browser) into database.
Save everthing else into session.
As for cookies, please note that it gets sent back and forth with each request. I don’t recommend using cookies, except maybe for session ID.