Earlier i would take username and password, match with db and on success redirect

Code:
session_register("myusername");
On every page that is viewed i would include a file that checks if the session is registered or not.

Now that session_register is deprecated, i did try to google alot to see what would be the best way to authenticate. With the above method i always noticed lots of hacking, session hijacking happening.

WHAT IS THE BEST AND MOST SECURED AND EFFICIENT WAY TO AUTHENTICATE. IS THERE AN OBJECT ORIENTED WAY OF ACCOMPLISHING THIS?

thank you