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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T23:21:45+00:00 2026-06-06T23:21:45+00:00

While my site was working without any problem I suddenly started to have a

  • 0

While my site was working without any problem I suddenly started to have a really high CPU usage on my server so I started to check the code more carefully and enabled E_ALL error reporting.

Then I found out I had a great many of this “notices”:

Notice: Undefined index: userID in /var/www/vhosts/mydomain.com/httpdocs/header.php on line 8

Most or them refer to unset cookies, for example this:

$uid = $_COOKIE['userID'];

If the user is unlogged I get a notice right there, and every time I use $uid.

What I want to know if this: Are this notices harmless or can they really cause any problems in my site? (Speed issues, errors etc.)

  • 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-06T23:21:47+00:00Added an answer on June 6, 2026 at 11:21 pm

    It is a notice only, try this code:

    $uid = isset($_COOKIE['userID']) ? $_COOKIE['userID'] : 0;
    

    It is not hamless (depending on the point of view), and you can disable this with error reporting functions, otherwise, the correct way is verify if index exists isset($_COOKIE['userID']) and if not, define a default value (null for instance)

    $var = isset($foo) ? $foo : 'default';
    

    You need to verify if variable exists, if you don’t known it exists or not.

    $var = 'foo'
    if($var == 'foo') { // I known $var is defined, because I have defined it.
        [..]
    }
    
    /** 
     * Above, I don't known if user go to mywebsite.com/index.php or
     * mywebsite.com/index.php?foo=bar, so, I need to verify if index is defined
     */
    if(isset($_GET['foo']) && $_GET['foo'] == 'bar') {
        [...]
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm working on an ASP.NET MVC site which will have a database. While I'm
Hi I made this site a while ago in my table days but have
While preparing to deploy a MongoDB powered site to a clients web server, their
While performing some upcoming maintenance, I'm going to have to redirect all site traffic
I have not having any luck getting my .htaccess with mod_rewrite working. Basically all
Working on an ASP.NET Project (not Web Site) and trying to Start without Debugging
I have a Google Map that suddenly stopped working for no apparent reason (I
While deveoping a site (using Forms authentication and InProc sessionstate) a frequently run into
Just wondering whats the best way to test Python CGI while developing a site?
While reading the OWASP site, I stumbled upon pages www.owasp.org/index.php/Category:Countermeasure and www.owasp.org/index.php/Category:Control . 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.