How to store search keyword or browsing history in database
So, I'm not sure just what you are looking for here. 

Since you are using xampp you can manage user sessions in php using their session functions. 

Apache also has it's own domain logs which you can keep for however long. 

You can also use redis for session management if you are ok with the session information being volatile. 

In general I don't see this as a database question, and suggest moving this question to one of the other SE sites such as Stack Overflow or Server Fault.