I have created a login script and the user, after entering his username and password, is redirected to the main page of the site named `main.php`, if of course entering valid data.

I have seen that by copying and paste the URL of this page to another explorer, the page opens succesfully without the need to do the logging process.
How can I stop this? Hcan I protect my `main.php` page so that only users after a registration process can only see it?