Grom-

Warning: session_start() [function.session-start]: Cannot send session cookie

26.06.2013, 17:41. Показов 1653. Ответов 4
Метки нет (Все метки)

Author24 — интернет-сервис помощи студентам
Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at /home/olzsu/public_html/index.php:1) in /home/olzsu/public_html/index.php on line 2

Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/olzsu/public_html/index.php:1) in /home/olzsu/public_html/index.php on line 2

Никак не могу избавиться.Помогите плиз!

PHP
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
<?php
session_start()?>
 
<!DOCTYPE html>
<html lang="en"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta charset="utf-8"/>
<?php
include('function/vk_fns.php');
$auth=false;
db_connect();
if(isset($_GET['ref']))
{
    $_SESSION['ref']=check_param($_GET['ref']);
}
$uid =$_GET['uid'];
if (isset($uid))
{
if(check_user($uid,$_GET['hash']))
 { 
    reg_user($uid);
   $auth = true;
  $_SESSION['uid'] = $uid;
  $_SESSION['hash']= $_GET['hash'];
}
 else
 {
   $auth = false;
  unset($_SESSION['uid']);
  unset($_SESSION['hash']);
 }
}
if (isset($_SESSION['uid']))
{
  if(check_user($_SESSION['uid'],$_SESSION['hash']))
 {
   $auth = true;
  
 }
 else
 {
   $auth = false;
 unset($_SESSION['uid']);
  unset($_SESSION['hash']);
   }  
}
 
?>
 
    <title>!</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="description" content="Olz - накрутка мне нравится,рассказать друзьям,друзей,участников в сообщество">
    <meta name="author" content="">
 
    <!-- Le styles -->
    <link href="http://bootstrap-ru.com/assets/css/bootstrap.css" rel="stylesheet">
    <style type="text/css">
      body {
        padding-top: 20px;
        padding-bottom: 40px;
      }
 
      /* Custom container */
      .container-narrow {
        margin: 0 auto;
        max-width: 700px;
      }
      .container-narrow > hr {
        margin: 30px 0;
      }
 
      /* Main marketing message and sign up button */
      .jumbotron {
        margin: 60px 0;
        text-align: center;
      }
      .jumbotron h1 {
        font-size: 72px;
        line-height: 1;
      }
      .jumbotron .btn {
        font-size: 21px;
        padding: 14px 24px;
      }
 
      /* Supporting marketing content */
      .marketing {
        margin: 60px 0;
      }
      .marketing p + h4 {
        margin-top: 28px;
      }
    </style>
    <link href="http://bootstrap-ru.com/assets/css/bootstrap-responsive.css" rel="stylesheet">
 
    <!-- HTML5 shim, for IE6-8 support of HTML5 elements -->
    <!--[if lt IE 9]>
      <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
    <![endif]-->
 
    <!-- Fav and touch icons -->
    <link rel="apple-touch-icon-precomposed" sizes="144x144" href="http://bootstrap-ru.com/assets/ico/apple-touch-icon-144-precomposed.png">
    <link rel="apple-touch-icon-precomposed" sizes="114x114" href="http://bootstrap-ru.com/assets/ico/apple-touch-icon-114-precomposed.png">
      <link rel="apple-touch-icon-precomposed" sizes="72x72" href="http://bootstrap-ru.com/assets/ico/apple-touch-icon-72-precomposed.png">
                    <link rel="apple-touch-icon-precomposed" href="http://bootstrap-ru.com/assets/ico/apple-touch-icon-57-precomposed.png">
                                   <link rel="shortcut icon" href="http://bootstrap-ru.com/assets/ico/favicon.png">
  </head>
 
  <body>
 
    <div class="container-narrow">
 
   <?php include 'page/menu.php'; ?>
 
      <hr>
      <?php if($auth==false){ include 'page/index.php';} else {include 'page/cabinet.php';}  ?>
 
     
 
      <hr>
 
     <?php include 'page/footer.php'; ?>
 
    </div> <!-- /container -->
 
    <!-- Le javascript
    ================================================== -->
    <!-- Placed at the end of the document so the pages load faster -->
    <script src="./index_files/jquery.js"></script>
    <script src="./index_files/bootstrap-transition.js"></script>
    <script src="./index_files/bootstrap-alert.js"></script>
    <script src="./index_files/bootstrap-modal.js"></script>
    <script src="./index_files/bootstrap-dropdown.js"></script>
    <script src="./index_files/bootstrap-scrollspy.js"></script>
    <script src="./index_files/bootstrap-tab.js"></script>
    <script src="./index_files/bootstrap-tooltip.js"></script>
    <script src="./index_files/bootstrap-popover.js"></script>
    <script src="./index_files/bootstrap-button.js"></script>
    <script src="./index_files/bootstrap-collapse.js"></script>
    <script src="./index_files/bootstrap-carousel.js"></script>
    <script src="./index_files/bootstrap-typeahead.js"></script>
 
  
 
</body></html>
cpp_developer
Эксперт
20123 / 5690 / 1417
Регистрация: 09.04.2010
Сообщений: 22,546
Блог
26.06.2013, 17:41
Ответы с готовыми решениями:

Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent
Пытаюсь сделать корзину товаров, проблема с session_start выдает вот такую ошибку: Warning: session_start() : Cannot send session cookie -...

Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent
Открыл движок а точне файл index.php та начало кода &lt;?php /** * Файл index.php расположен в корне CMS является единственной...

Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by
session_start(); if (!isset($_SESSION)) $_SESSION=0; echo &quot;вы обновили страницу &quot;.$_SESSION++.&quot; раз. &quot;; echo &quot;&lt;br&gt;&lt;a...

4
 Аватар для AndreyDyakonov
122 / 120 / 7
Регистрация: 21.04.2013
Сообщений: 615
26.06.2013, 17:48
Цитата Сообщение от Grom- Посмотреть сообщение
Помогите плиз!
Вы целиком код видели? Вам же говорит система: заголовки уже отправлены. Стартуйте сессию до отправки заголовков
0
 Аватар для lagrei
6 / 6 / 1
Регистрация: 20.06.2013
Сообщений: 45
26.06.2013, 17:50
PHP
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
<?php
session_start();
 
include('function/vk_fns.php');
$auth=false;
db_connect();
if(isset($_GET['ref']))
{
    $_SESSION['ref']=check_param($_GET['ref']);
}
$uid =$_GET['uid'];
if (isset($uid))
{
if(check_user($uid,$_GET['hash']))
 { 
    reg_user($uid);
   $auth = true;
  $_SESSION['uid'] = $uid;
  $_SESSION['hash']= $_GET['hash'];
}
 else
 {
   $auth = false;
  unset($_SESSION['uid']);
  unset($_SESSION['hash']);
 }
}
if (isset($_SESSION['uid']))
{
  if(check_user($_SESSION['uid'],$_SESSION['hash']))
 {
   $auth = true;
  
 }
 else
 {
   $auth = false;
 unset($_SESSION['uid']);
  unset($_SESSION['hash']);
   }  
}
 
?>
 <!DOCTYPE html>
<html lang="en"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta charset="utf-8"/>
 
    <title>!</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="description" content="Olz - накрутка мне нравится,рассказать друзьям,друзей,участников в сообщество">
    <meta name="author" content="">
 
    <!-- Le styles -->
    <link href="http://bootstrap-ru.com/assets/css/bootstrap.css" rel="stylesheet">
    <style type="text/css">
      body {
        padding-top: 20px;
        padding-bottom: 40px;
      }
 
      /* Custom container */
      .container-narrow {
        margin: 0 auto;
        max-width: 700px;
      }
      .container-narrow > hr {
        margin: 30px 0;
      }
 
      /* Main marketing message and sign up button */
      .jumbotron {
        margin: 60px 0;
        text-align: center;
      }
      .jumbotron h1 {
        font-size: 72px;
        line-height: 1;
      }
      .jumbotron .btn {
        font-size: 21px;
        padding: 14px 24px;
      }
 
      /* Supporting marketing content */
      .marketing {
        margin: 60px 0;
      }
      .marketing p + h4 {
        margin-top: 28px;
      }
    </style>
    <link href="http://bootstrap-ru.com/assets/css/bootstrap-responsive.css" rel="stylesheet">
 
    <!-- HTML5 shim, for IE6-8 support of HTML5 elements -->
    <!--[if lt IE 9]>
      <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
    <![endif]-->
 
    <!-- Fav and touch icons -->
    <link rel="apple-touch-icon-precomposed" sizes="144x144" href="http://bootstrap-ru.com/assets/ico/apple-touch-icon-144-precomposed.png">
    <link rel="apple-touch-icon-precomposed" sizes="114x114" href="http://bootstrap-ru.com/assets/ico/apple-touch-icon-114-precomposed.png">
      <link rel="apple-touch-icon-precomposed" sizes="72x72" href="http://bootstrap-ru.com/assets/ico/apple-touch-icon-72-precomposed.png">
                    <link rel="apple-touch-icon-precomposed" href="http://bootstrap-ru.com/assets/ico/apple-touch-icon-57-precomposed.png">
                                   <link rel="shortcut icon" href="http://bootstrap-ru.com/assets/ico/favicon.png">
  </head>
 
  <body>
 
    <div class="container-narrow">
 
   <?php include 'page/menu.php'; ?>
 
      <hr>
      <?php if($auth==false){ include 'page/index.php';} else {include 'page/cabinet.php';}  ?>
 
     
 
      <hr>
 
     <?php include 'page/footer.php'; ?>
 
    </div> <!-- /container -->
 
    <!-- Le javascript
    ================================================== -->
    <!-- Placed at the end of the document so the pages load faster -->
    <script src="./index_files/jquery.js"></script>
    <script src="./index_files/bootstrap-transition.js"></script>
    <script src="./index_files/bootstrap-alert.js"></script>
    <script src="./index_files/bootstrap-modal.js"></script>
    <script src="./index_files/bootstrap-dropdown.js"></script>
    <script src="./index_files/bootstrap-scrollspy.js"></script>
    <script src="./index_files/bootstrap-tab.js"></script>
    <script src="./index_files/bootstrap-tooltip.js"></script>
    <script src="./index_files/bootstrap-popover.js"></script>
    <script src="./index_files/bootstrap-button.js"></script>
    <script src="./index_files/bootstrap-collapse.js"></script>
    <script src="./index_files/bootstrap-carousel.js"></script>
    <script src="./index_files/bootstrap-typeahead.js"></script>
 
</body></html>
заголовки уже отправились, сделай так должно сработать
0
0 / 0 / 0
Регистрация: 29.05.2013
Сообщений: 5
26.06.2013, 18:06
Попробуйте следующее:
- проверьте код на наличие ошибок (к примеру в той же второй строке нет ";", не знаю как Ваш php на это реагирует, но мой еррорит по-дикому - возможно часть проблемы в этом);
- запустите код построчно (создайте отдельно копию этого файла, а в самом файле попробуйте запускать php по одной строке; проверил бы сам для Вас, но всех исходников здесь нет);
- запустите скрипт и посмотрите лог запросов от него (обычно либо лежит в конфигурационных файлах веб-сервера, либо, если его затребовать, сохраняется рядом со скриптом; возможно какая-то команда блокирует или опережает старт сессии).
0
Grom-
26.06.2013, 18:11
Спасибо всем за ответы будем разбираться!
Надоела реклама? Зарегистрируйтесь и она исчезнет полностью.
raxper
Эксперт
30234 / 6612 / 1498
Регистрация: 28.12.2010
Сообщений: 21,154
Блог
26.06.2013, 18:11
Помогаю со студенческими работами здесь

Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent
У меня на компе все ОК, но после загрузки на хост получаю предупреждения и нечего не работает Warning: session_start() : Cannot send...

Ошибка - Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent
Добрый день!!! Хочу реализовать регистрацию и авторизацию пользователей. Вроде все правильно делаю. Не могу понять из-за чего ошибка...

Warning: session_start() [function.session-start]: Cannot send session cache
Привет. Сегодня решиль сделать у себя в сайте регистрацию она работает нормально все без проблем, но проблема с сессии у меня вот что...

Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent
Ребят, я полный краб в php пока что ) При входе в админку вордпреса белый экран и Notice: Use of undefined constant ddsg_language -...

Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent
И опять я, не прошло и дня как я столкнулся с новой проблемой (старую решил сам, очень я невнимательный ) но уже просидев несколько часов с...


Искать еще темы с ответами

Или воспользуйтесь поиском по форуму:
5
Ответ Создать тему
Опции темы

Новые блоги и статьи
Вопросы на собеседованиях по микросервисам
ArchitectMsa 27.03.2025
Работодатели ищут не просто разработчиков, знающих базовые концепции, а специалистов, разбирающихся в тонкостях масштабирования, отказоустойчивости и производительности. Сейчас на первый план выходят. . .
Взаимодействие Python с REST API
py-thonny 27.03.2025
REST API - это архитектурный стиль взаимодействия компонентов распределённого приложения в сети. Python располагает функциональным набором инструментов для работы с REST API и основная библиотека для. . .
sshd restrictions, ssh access limitations
jigi33 26.03.2025
sshd restrictions | ssh access limitations рестрикции доступа на сервер sshd статья: https:/ / www. golinuxcloud. com/ restrict-allow-ssh-certain-users-groups-rhel
Компиляция C++ с Clang API
NullReferenced 24.03.2025
Компиляторы обычно воспринимаются как черные ящики, которые превращают исходный код в исполняемые файлы. Мы запускаем компилятор командой в терминале, и вуаля — получаем бинарник. Но что если нужно. . .
Многопоточное программировани­е в C#: Класс Thread
UnmanagedCoder 24.03.2025
Когда запускается приложение на компьютере, операционная система создаёт для него процесс - виртуальное адресное пространство. В C# этот процесс изначально получает один поток выполнения — главный. . .
SwiftUI Data Flow: Передача данных между представлениями
mobDevWorks 23.03.2025
При первом знакомстве со SwiftUI кажется, что фреймворк предлагает избыточное количество механизмов для передачи данных: @State, @Binding, @StateObject, @ObservedObject, @EnvironmentObject и другие. . . .
Моки в Java: Сравниваем Mockito, EasyMock, JMockit
Javaican 23.03.2025
Как протестировать класс, который зависит от других сложных компонентов, таких как базы данных, веб-сервисы или другие классы, с которыми и так непросто работать в тестовом окружении? Для этого и. . .
Архитектурные паттерны микросервисов: ТОП-10 шаблонов
ArchitectMsa 22.03.2025
Популярность микросервисной архитектуры объясняется множеством важных преимуществ. К примеру, она позволяет командам разработчиков работать независимо друг от друга, используя различные технологии и. . .
Оптимизация рендеринга в Unity: Сортировка миллиона спрайтов
GameUnited 22.03.2025
Помните, когда наличие сотни спрайтов в игре приводило к существенному падению производительности? Время таких ограничений уходит в прошлое. Сегодня геймдев сталкивается с задачами совершенно иного. . .
Образование и практика
Igor3D 21.03.2025
Добрый день А вот каково качество/ эффективность ВУЗовского образования? Аналитическая геометрия изучается в первом семестре и считается довольно легким курсом, что вполне справедливо. Ну хорошо,. . .
КиберФорум - форум программистов, компьютерный форум, программирование
Powered by vBulletin
Copyright ©2000 - 2025, CyberForum.ru