I just made the registration form for my website, however I have zero knowledge on how to remember the user is logged in through the session. I think I could simply store his IP on a Table on my database when authenticated and remove it when he logs out.
Is there anything wrong about this approach? If there is what should I do instead of it?
If you are using PHP than you can do this:
And when he logs out you remove the username from the session