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

  • Home
  • SEARCH
  • 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 7730971
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T06:21:47+00:00 2026-06-01T06:21:47+00:00

I am having trouble setting and echoing out a cookie, I was wondering if

  • 0

I am having trouble setting and echoing out a cookie, I was wondering if you could help me out, I am relatively new to php but I can work my way around. Here is the code…

if (empty($_COOKIE['source'])) {
$kw = $_SESSION["keyword"];
//echo $kw;
$needle = array(
    "bomanite"
);
if (multineedle_stripos($kw, $needle) || $engineName == 'Direct' || $engineName == '') {
    // branded search, don't display lead tracking phone/email
    $source = "direct";
    $liveemail = "bomanite@bomanite.ca";
    $livephone = "<span id='bom-phone'>Call us for a Quote: (416) 800 5545</span>";
} elseif ($engineName == 'ppc') {
    $source = "ppc";
    $liveemail = "bomanite@bomanite.ca";
    $livephone = "<span id='bom-phone'>Call us for a Quote: (416) 800 5446</span>";
} else {
    $source = "organic";
    $liveemail = "bomanite@bomanite.ca";
    $livephone = "<span id='bom-phone'>Call us for a Quote: (905) 660 5545</span>";
}
    setcookie("source", $source, time() + (60 * 60 * 24 * 30), '/', 'bomanite.cidev.info/');
    setcookie("kw", $kw, time() + (60 * 60 * 24 * 30), '/', 'bomanite.cidev.info/');
setcookie("liveemail", $liveemail,time() + (60 * 60 * 24 * 30), '/', 'bomanite.cidev.info/');
setcookie("livephone", $livephone,time() + (60 * 60 * 24 * 30), '/', 'bomanite.cidev.info/');
} else {
$source = $_COOKIE['source'];
$kw     = $_COOKIE["kw"];
$liveemail = $_COOKIE['liveemail'];
$livephone = $_COOKIE['livephone'];
}
?>
  • 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-06-01T06:21:48+00:00Added an answer on June 1, 2026 at 6:21 am

    Cookies are very sensitive to path.. Can you try this?

    setcookie("source", $source, time() + (60 * 60 * 24 * 30), '/');
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Having trouble setting up a website for my wedding. Hope someone can find out
I have a script which successfully creates new nodes. But I'm having trouble setting
I'm having trouble setting up a new eclipse installation with the -vm option. I'm
Java newbie here, I'm having trouble setting a new line in this code: String
I'm having trouble setting up a new server using Moonshine and Capistrano. It seems
I am having trouble setting up VS2010 so I can debug in IIS: I
simple question here, I am writing a function, but I was having trouble setting
I am creating a file tree using PHP & jQuery, but I'm having trouble
I am having trouble setting up a query, it seems very simple but I
I am having trouble setting up the configuration of Spring.Net so that I can

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.