PHP warning

Undefined global variable $_SESSION

/home3/jilan/public_html/protected/views/ngo/country.php(289)

277                                 onclick="toggleLike(this, <?php echo $row['id']; ?>)">
278                                 <i class="fa fa-thumbs-up" aria-hidden="true" style="font-size:16px"></i>
279                                 <span class="like-count"><?php echo $likeCount; ?></span>
280                                 <span class="like-text"><?php //echo $isLiked ? 'Unlike' : 'Like'; ?></span>
281                             </button>
282                             <div class="liked-users" id="liked-users-<?php echo $row['id']; ?>"></div>
283                                 <button class="button commentButton" onclick="toggleComments(this, <?php echo $row['id']; ?>)"><i class="fa fa-comments-o" style="font-size:16px"></i> Comment</button>
284                                 
285                                     <div class="commentSection" style="display: none;" data-postid="<?php echo $row['id']; ?>">
286                                         <div style="display: flex; align-items: center;">
287                                             <input type="hidden" name="cmtid" value="<?php echo $row['id']; ?>">
288                                             <?php 
289                                              $id = $_SESSION['userfolder'];
290                                              $stmt = $GLOBALS["mysqli_con"]->prepare("SELECT * FROM `login` WHERE userfolder = ?");
291                                             $stmt->bind_param("s", $id);  // "s" means the type is string
292                                             $stmt->execute();
293                                             $trestv = $stmt->get_result();
294                                             
295                                             while ($jilan = $trestv->fetch_array()) {
296                                                 $lnk = !empty($jilan['logo']) ? REDIRECT . '/usersimages/' . $jilan['logo'] : "https://globalfamily.in/images/dp.jpg";
297                                             ?>
298                                             
299                                             <img src="<?php echo $lnk; ?>" alt="site" height="54" width="54" class="rounded-circle" name="image">
300                                             <input type="hidden" name="uname" value="<?php echo $jilan['userfolder']; ?>">
301                                             <?php } ?>

Stack Trace

#4
+
 /home3/jilan/public_html/protected/controllers/NgoController.php(58): CController->render("country")
53        public function actionSearch() {
54         $this->render('search');
55     }
56          
57        public function actionCountry() {
58         $this->render('country');
59     }
60   public function actionDisplay() {
61         $this->render('display');
62     }
63     /**
#17
+
 /home3/jilan/public_html/index.php(22): CApplication->run()
17     defined('YII_DEBUG') or define('YII_DEBUG', true);
18 // specify how many levels of call stack should be shown in each log message
19     defined('YII_TRACE_LEVEL') or define('YII_TRACE_LEVEL', 3);
20 
21     require_once($yii);
22     Yii::createWebApplication($config)->run();
23 }  
2026-03-10 18:25:03 Apache Yii Framework/1.1.10