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 8342275
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T05:43:19+00:00 2026-06-09T05:43:19+00:00

So i have a cookies that i know is set properly (using firefox get

  • 0

So i have a cookies that i know is set properly (using firefox get page info) and I keep getting the error/ warning “Notice: Undefined index: “. I am accessing the cookie by using $_COOKIE['username']; and when I do if(isset($_COOKIE['username'])) the code does not run. However I can see the unexpired cookie in firefox get page info. Just for reference here is my set the cookie code : setcookie('username', $username, time()+3600*24);

  • 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-09T05:43:20+00:00Added an answer on June 9, 2026 at 5:43 am

    You were probably defining the cookie in a php file that was in a different folder of your php file where you were calling your isset.

    So adding ‘/’ as the default folder of the cookie makes it availaible for the entire website.

    Sometimes, you don’t want this to happen, because you might want to have two cookies with the same name but different values depending on which folder you’re in.

    Example: A website with 2 languages, you could have $_COOKIE['language'] = 'en'; in the /en/ folder and have $_COOKIE['language'] = 'fr'; in the /fr/ folder.

    So when you’re setting a cookie without specifying its directory, you have to remember that it will only be available only for the files in the same folder or in subfolders.

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

Sidebar

Related Questions

Suppose that you have to set 12 cookies, would it be better to store
I have an index page that detects if users have JavaScript and cookies enabled
I just want to clear this up. I know that if I have set
I have a function that saves cookies cookievalue= escape(document.passwordCheck.oldPassword.value) + ;; document.cookie=oldCookie= + cookievalue
I have authentication logic that uses cookies. The model attributes are initialized from cookies,
I have a little script that checks for cookies and I was wondering how
I have a php web application that uses big cookies to store a lot
I have a simple page view tracker that uses a combination of PHP and
I am having a weird bug when I set and get cookies after a
im practicing on creating a html using jquery cookies. i already know how to

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.