Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

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.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6151339
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T19:45:21+00:00 2026-05-23T19:45:21+00:00

Thanks for helping with this. I have a script that checks logins and then

  • 0

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);
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T19:45:22+00:00Added an answer on May 23, 2026 at 7:45 pm

    Using:

    <?php
    
    $row = array(
        'User_ID' => '1',
        'UserName' => '1',
        'Access_Level' => '1',
        'Db_Con' => '1'
    );
    
    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),"/");
    
    // This will not be set, and the cookie is not created.
    setcookie('db_con2', $row['Db_Con2'], time()+ (60*15),"/");
    
    ?>
    

    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, Security tab, View Cookies button. 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.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Thanks to everyone out there helping newbies like me. So far I have this:
THANKS FOR HELPING!!! Ok... So I am trying to write a script that will
Sorry if this is too simple, but thanks in advance for helping. This is
I have a very basic jQuery script that slides a title from bottom to
Thanks in advance for helping me out (for those who have time and are
Hello everyone and thanks in advance for reading this.. I have the following html
I have posted this a few times looking for some help, I cant seem
So I have several lines in a file that looks like this useradmin:$NT$asdlfkjwaeroisglkwerlkj23424tlj::: useradmin:c2q3r4lsdfk23rlsdfkj3rjsdflk2k23:::
I have been using this simple script to generate images from text: <?php header('Content-type:
I have make a script for make columns the same height. This is my

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.