I have an index.php file in it as soon as you enter the form of registration and authorization. If you are logged in when you press the button, the cookie will come out and transfer to the news.php file.

How to make it so that if the cookie is issued with authorization, when you go to index.php, it will immediately transfer to news.php ???

    1 answer 1

    Obviously. Check for cookies and if it exists and is not empty, then redirect to news.php. Something like:

    if(isset($_COOKIE['user_auth']) && !empty($_COOKIE['user_auth'])) { // REDIRECT TO NEWS.PHP }