Thanks for helping with this.
I have a script that checks logins and then sets some cookies. There are 4 cookies that are being set, (later I will probably move some to server session but for now I am using cookies.
The issue that I am having is that only the first 2 of the 4 are being set before the rest of the script is being executed. Can anyone see why?
// If there is a row, and only 1 row, then the details are correct. Set the cookie and re-direct
$row = mysqli_fetch_array($data);
setcookie('user_id', $row['User_ID'], time()+ (60*15),"/");
setcookie('user_name', $row['UserName'], time()+ (60*15),"/");
setcookie('access_Level', $row['Access_Level'], time()+ (60*15),"/");
setcookie('db_con', $row['Db_Con'], time()+ (60*15),"/");
$home_url = $link . "application/views/Dashboard.php";
header('Location: ' . $home_url);
Using:
http://jfcoder.com/test/setcookie.php
In Firefox, I check to see the cookies for a page by right-clicking on the page,
View Page Info,Securitytab,View Cookiesbutton. All four cookies show up on that page in my browser. The last one does not (since it is has no value).I’m thinking your column names are not spelled/capitalized correctly, or some other issue, and that
$row['Access_Level']and$row['Db_Con']are empty columns in your result.