PHP warning

Undefined global variable $_SESSION

/home3/jilan/public_html/protected/views/ngo/category.php(390)

378                                 onclick="toggleLike(this, <?php echo $row['id']; ?>)">
379                                 <i class="fa fa-thumbs-up" aria-hidden="true" style="font-size:16px"></i>
380                                 <span class="like-count"><?php echo $likeCount; ?></span>
381                                 <span class="like-text"><?php // echo $isLiked ? 'Unlike' : 'Like'; ?></span>
382                             </button>
383                             <div class="liked-users" id="liked-users-<?php echo $row['id']; ?>"></div>
384                                 <button class="button commentButton" onclick="toggleComments(this, <?php echo $row['id']; ?>)"><i class="fa fa-comments-o" style="font-size:16px"></i> Comment</button>
385                                 
386                                     <div class="commentSection" style="display: none;" data-postid="<?php echo $row['id']; ?>">
387                                         <div style="display: flex; align-items: center;">
388                                             <input type="hidden" name="cmtid" value="<?php echo $row['id']; ?>">
389                                             <?php 
390                                              $id = $_SESSION['userfolder'];
391                                              $stmt = $GLOBALS["mysqli_con"]->prepare("SELECT * FROM `login` WHERE userfolder = ?");
392                                             $stmt->bind_param("s", $id);  // "s" means the type is string
393                                             $stmt->execute();
394                                             $trestv = $stmt->get_result();
395                                             
396                                             while ($jilan = $trestv->fetch_array()) {
397                                                 $lnk = !empty($jilan['logo']) ? REDIRECT . '/usersimages/' . $jilan['logo'] : "https://globalfamily.in/images/dp.jpg";
398                                             ?>
399                                             
400                                             <img src="<?php echo $lnk; ?>" alt="site" height="54" width="54" class="rounded-circle" name="image">
401                                             <input type="hidden" name="uname" value="<?php echo $jilan['userfolder']; ?>">
402                                             <?php } ?>

Stack Trace

#4
+
 /home3/jilan/public_html/protected/controllers/NgoController.php(71): CController->render("category")
66      */
67     public function actionGrants() {
68         $this->render('grants');
69     }
70        public function actionCategory() {
71         $this->render('category');
72     }
73  public function actionProjects() {
74         $this->render('projects');
75     }
76 
#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:33:34 Apache Yii Framework/1.1.10