Answer the question
In order to leave comments, you need to log in
How to redirect an unauthorized user to the login page?
There is the following method:
protected function auth() {
if(isset($_COOKIE['gotostreet'])) {
// Тут код проверки куки
}
// если куки нет перенаправляет на страницу авторизации
else header("Location: /login");
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question