I dont want users to access other users profiles. So this is what I’m doing. Is it fine?
<?php
session_start();
if($_SESSION['username']=='ryan'){
header("location:dash.php");
}
else{
location("location:404.php");
}
?>
is this secure?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
This is secure if the user can not modify the value of
$_SESSION['username']to set it toryan; but you forgot theexitafter theheader('Location:...').