Error
Mako: 8.1.0, PHP: 8.2.6

mako\session\exceptions\SessionException

Attempted to set a secure cookie over a non-secure connection.

Stack Trace
Environment
Database
- Error mako\session\exceptions\SessionException
Location: /var/www/hbrutvikling/hbr/vendor/mako/framework/src/mako/session/Session.php on line 234.
228
	 * Adds a session cookie to the response.
229
	 */
230
	protected function setCookie(): void
231
	{
232
		if($this->options['cookie_options']['secure'] && !$this->request->isSecure())
233
		{
234
			throw new SessionException('Attempted to set a secure cookie over a non-secure connection.');
235
		}
236

237
		$this->response->getCookies()->addSigned($this->options['name'], $this->sessionId, $this->options['cookie_ttl'], $this->options['cookie_options']);
238
	}
239

240
	/**
29 Vendor mako\session\Session->setCookie()
Location: /var/www/hbrutvikling/hbr/vendor/mako/framework/src/mako/session/Session.php on line 173.
167
		{
168
			$this->sessionId = $this->generateId();
169
		}
170

171
		// Create a new / update the existing session cookie
172

173
		$this->setCookie();
174

175
		// Load the session data
176

177
		$this->loadData();
178

179
		// Create a session token if we don't have one
28 Vendor mako\session\Session->start()
Location: /var/www/hbrutvikling/hbr/vendor/mako/framework/src/mako/session/Session.php on line 143.
137
		$this->autoCommit = $autoCommit;
138

139
		$this->options = array_replace_recursive($this->options, $options);
140

141
		$this->gc();
142

143
		$this->start();
144
	}
145

146
	/**
147
	 * Destructor.
148
	 */
149
	public function __destruct()
27 Vendor mako\session\Session->__construct()
Location: /var/www/hbrutvikling/hbr/vendor/mako/framework/src/mako/application/services/SessionService.php on line 120.
114
				'cookie_ttl'     => $config['ttl']['cookie'],
115
				'cookie_options' => $config['cookie_options'],
116
			];
117

118
			// Create session and return it
119

120
			return new Session($container->get(Request::class), $container->get(Response::class), $this->getStore($container, $config, $classWhitelist), $options);
121
		});
122
	}
123
}
124
26 Vendor mako\application\services\SessionService->mako\application\services\{closure}()
Location: /var/www/hbrutvikling/hbr/vendor/mako/framework/src/mako/syringe/Container.php on line 431.
425
	 * @return object
426
	 */
427
	protected function closureFactory(Closure $factory, array $parameters): object
428
	{
429
		// Pass the container as the first parameter followed by the the provided parameters
430

431
		return $factory(...[$this, ...$parameters]);
432
	}
433

434
	/**
435
	 * Creates a class instance using reflection.
436
	 *
437
	 * @param  string $class      Class name
25 Vendor mako\syringe\Container->closureFactory()
Location: /var/www/hbrutvikling/hbr/vendor/mako/framework/src/mako/syringe/Container.php on line 481.
475
	public function factory($class, array $parameters = []): object
476
	{
477
		// Instantiate class
478

479
		if($class instanceof Closure)
480
		{
481
			$instance = $this->closureFactory($class, $parameters);
482
		}
483
		else
484
		{
485
			$instance = $this->reflectionFactory($class, $parameters);
486
		}
487

24 Vendor mako\syringe\Container->factory()
Location: /var/www/hbrutvikling/hbr/vendor/mako/framework/src/mako/syringe/Container.php on line 558.
552
		{
553
			return $this->instances[$class];
554
		}
555

556
		// Create new instance
557

558
		$instance = $this->factory($this->resolveHint($class), $parameters);
559

560
		// Store the instance if it's registered as a singleton
561

562
		if($reuseInstance && isset($this->hints[$class]) && $this->hints[$class]['singleton'])
563
		{
564
			$this->instances[$class] = $instance;
23 Vendor mako\syringe\Container->get()
Location: /var/www/hbrutvikling/hbr/vendor/mako/framework/src/mako/application/services/GatekeeperService.php on line 71.
65
				];
66

67
				$request = $container->get(Request::class);
68

69
				$response = $container->get(Response::class);
70

71
				$session = $container->get(HttpSession::class);
72

73
				return new Session($userRepository, $groupRepository, $request, $response, $session, $options);
74
			};
75

76
			// Create and return the gatekeeper instance
77

22 Vendor mako\application\services\GatekeeperService::mako\application\services\{closure}()
Location: /var/www/hbrutvikling/hbr/vendor/mako/framework/src/mako/gatekeeper/Gatekeeper.php on line 160.
154
	 * @return \mako\gatekeeper\adapters\AdapterInterface
155
	 */
156
	protected function adapterFactory(string $name): AdapterInterface
157
	{
158
		$factory = $this->adapterFactories[$name];
159

160
		return $this->adapters[$name] = $factory();
161
	}
162

163
	/**
164
	 * Returns an adapter instance.
165
	 *
166
	 * @param  string|null                                $name Adapter name
21 Vendor mako\gatekeeper\Gatekeeper->adapterFactory()
Location: /var/www/hbrutvikling/hbr/vendor/mako/framework/src/mako/gatekeeper/Gatekeeper.php on line 173.
167
	 * @return \mako\gatekeeper\adapters\AdapterInterface
168
	 */
169
	public function adapter(?string $name = null): AdapterInterface
170
	{
171
		$name ??= $this->defaultAdapter;
172

173
		return $this->adapters[$name] ?? $this->adapterFactory($name);
174
	}
175

176
	/**
177
	 * Magic shortcut to the default adapter.
178
	 *
179
	 * @param  string $name      Method name
20 Vendor mako\gatekeeper\Gatekeeper->adapter()
Location: /var/www/hbrutvikling/hbr/vendor/mako/framework/src/mako/gatekeeper/Gatekeeper.php on line 185.
179
	 * @param  string $name      Method name
180
	 * @param  array  $arguments Method arguments
181
	 * @return mixed
182
	 */
183
	public function __call(string $name, array $arguments)
184
	{
185
		return $this->adapter()->$name(...$arguments);
186
	}
187
}
188
19 App mako\gatekeeper\Gatekeeper->__call()
Location: /var/www/hbrutvikling/hbr/app/storage/cache/views/a522de55ada9dc7e09736b5e27ecaf15.php on line 25.
19
                <li><a href="<?php echo $this->escapeHTML($url->toRoute('showMyCommune'), $__charset__); ?>"><?php echo $this->escapeHTML($i18n->get('ui.navbar.my_commune'), $__charset__); ?></a></li>
20
                <li> <a href= "<?php echo $this->escapeHTML($url->toRoute('showNewspapers'), $__charset__); ?>" target="_blank"> <?php echo $this->escapeHTML($i18n->get('ui.navbar.newspapers'), $__charset__); ?> </a> </li>
21
                <li><a href="<?php echo $this->escapeHTML($url->toRoute('showregpersons'), $__charset__); ?>"><?php echo $this->escapeHTML($i18n->get('ui.navbar.regs'), $__charset__); ?></a></li> 
22
                <li><a href="<?php echo $this->escapeHTML($url->toRoute('references'), $__charset__); ?>"><?php echo $this->escapeHTML($i18n->get('ui.navbar.references'), $__charset__); ?></a></li>
23
                <li><a href="<?php echo $this->escapeHTML($url->toRoute('allstat'), $__charset__); ?>"><?php echo $this->escapeHTML($i18n->get('ui.navbar.allstat'), $__charset__); ?></a></li>
24

25
                <?php if($gatekeeper->isLoggedIn() === true): ?>                
26
                <li><a href="<?php echo $this->escapeHTML($url->toRoute('troubleshoot'), $__charset__); ?>"><?php echo $this->escapeHTML($i18n->get('ui.navbar.troubleshoot'), $__charset__); ?></a></li>
27
                <li><a href="<?php echo $this->escapeHTML($url->toRoute('showManualLogWindow'), $__charset__); ?>"><?php echo $this->escapeHTML($i18n->get('ui.navbar.manlog'), $__charset__); ?></a></li>
28
                <li><a href="<?php echo $this->escapeHTML($url->toRoute('editProfile'), $__charset__); ?>"><?php echo $this->escapeHTML($i18n->get('ui.navbar.profile'), $__charset__); ?></a></li>                    
29
                <?php if($gatekeeper->getUser()->getEmail() === "Lars.Holden@nr.no" || $gatekeeper->getUser()->getEmail() === "svetlana@nr.no"): ?>
30
                <li><a href="<?php echo $this->escapeHTML($url->toRoute('autolenking'), $__charset__); ?>"><?php echo $this->escapeHTML($i18n->get('ui.navbar.autolenking'), $__charset__); ?></a></li>
31
                <li><a href="<?php echo $this->escapeHTML($url->toRoute('admin'), $__charset__); ?>"><?php echo $this->escapeHTML($i18n->get('ui.navbar.admin'), $__charset__); ?></a></li>
18 Vendor include()
Location: /var/www/hbrutvikling/hbr/vendor/mako/framework/src/mako/view/renderers/PHP.php on line 32.
26
	public function render(string $__view__, array $__variables__): string
27
	{
28
		extract($__variables__, EXTR_SKIP);
29

30
		ob_start();
31

32
		include($__view__);
33

34
		return ob_get_clean();
35
	}
36
}
37

Arguments:

  1. (86) "/var/www/hbrutvikling/hbr/app/storage/cache/views/a522de55ada9dc7e09736b5e27ecaf15.php"
    
17 Vendor mako\view\renderers\PHP->render()
Location: /var/www/hbrutvikling/hbr/vendor/mako/framework/src/mako/view/renderers/Template.php on line 152.
146

147
		if($this->needToCompile($__view__, $compiled))
148
		{
149
			$this->compile($__view__);
150
		}
151

152
		return parent::render($compiled, array_merge($__variables__, ['__renderer__' => $this]));
153
	}
154
}
155
16 Vendor mako\view\renderers\Template->render()
Location: /var/www/hbrutvikling/hbr/vendor/mako/framework/src/mako/view/View.php on line 95.
89
	 * Returns the rendered view.
90
	 *
91
	 * @return string
92
	 */
93
	public function render(): string
94
	{
95
		return $this->renderer->render($this->path, $this->variables);
96
	}
97

98
	/**
99
	 * Returns the rendered view.
100
	 *
101
	 * @return string
15 App mako\view\View->render()
Location: /var/www/hbrutvikling/hbr/app/storage/cache/views/9a7d9b1e4b142f1737a7e2aa4806928b.php on line 94.
88
                    <?php echo $__viewfactory__->create('home.column4', get_defined_vars())->render(); ?>
89
                </div>
90
            </div> 
91
        </div>
92

93
        <?php $__renderer__->close(); ?> 
94
<?php echo $__view__->render(); ?>
14 Vendor include()
Location: /var/www/hbrutvikling/hbr/vendor/mako/framework/src/mako/view/renderers/PHP.php on line 32.
26
	public function render(string $__view__, array $__variables__): string
27
	{
28
		extract($__variables__, EXTR_SKIP);
29

30
		ob_start();
31

32
		include($__view__);
33

34
		return ob_get_clean();
35
	}
36
}
37

Arguments:

  1. (86) "/var/www/hbrutvikling/hbr/app/storage/cache/views/9a7d9b1e4b142f1737a7e2aa4806928b.php"
    
13 Vendor mako\view\renderers\PHP->render()
Location: /var/www/hbrutvikling/hbr/vendor/mako/framework/src/mako/view/renderers/Template.php on line 152.
146

147
		if($this->needToCompile($__view__, $compiled))
148
		{
149
			$this->compile($__view__);
150
		}
151

152
		return parent::render($compiled, array_merge($__variables__, ['__renderer__' => $this]));
153
	}
154
}
155
12 Vendor mako\view\renderers\Template->render()
Location: /var/www/hbrutvikling/hbr/vendor/mako/framework/src/mako/view/View.php on line 95.
89
	 * Returns the rendered view.
90
	 *
91
	 * @return string
92
	 */
93
	public function render(): string
94
	{
95
		return $this->renderer->render($this->path, $this->variables);
96
	}
97

98
	/**
99
	 * Returns the rendered view.
100
	 *
101
	 * @return string
11 Vendor mako\view\View->render()
Location: /var/www/hbrutvikling/hbr/vendor/mako/framework/src/mako/view/ViewFactory.php on line 330.
324
	 * @param  string $view      View
325
	 * @param  array  $variables View variables
326
	 * @return string
327
	 */
328
	public function render(string $view, array $variables = []): string
329
	{
330
		return $this->create($view, $variables)->render();
331
	}
332
}
333
10 App mako\view\ViewFactory->render()
Location: /var/www/hbrutvikling/hbr/app/controllers/Index.php on line 29.
23
     */
24
    public function welcome() {
25
        return $this->view->render('home.hello');
26
    }
27

28
    public function home() {
29
        return $this->view->render('home.home');
30
    }
31

32
    public function manual() {
33
        $this->session->put('lasturl', $this->urlBuilder->current());
34
        return $this->view->render('home.manual');
35
    }
9 Vendor app\controllers\Index->home()
Location: /var/www/hbrutvikling/hbr/vendor/mako/framework/src/mako/syringe/Container.php on line 597.
591
	public function call(callable $callable, array $parameters = [])
592
	{
593
		if(is_array($callable))
594
		{
595
			$reflection = new ReflectionMethod($callable[0], $callable[1]);
596

597
			return $callable(...$this->resolveParameters($reflection->getParameters(), $parameters, $reflection->getDeclaringClass(), $callable[1]));
598
		}
599

600
		return $callable(...$this->resolveParameters((new ReflectionFunction($callable))->getParameters(), $parameters));
601
	}
602
}
603
8 Vendor mako\syringe\Container->call()
Location: /var/www/hbrutvikling/hbr/vendor/mako/framework/src/mako/http/routing/Dispatcher.php on line 283.
277

278
		if(empty($returnValue))
279
		{
280
			// The before action method didn't return any data so we can set the
281
			// response body to whatever the route action returns
282

283
			$this->response->setBody($this->container->call([$controller, $method], $parameters));
284

285
			// Execute the after action method if we have one
286

287
			if(method_exists($controller, 'afterAction'))
288
			{
289
				$this->container->call([$controller, 'afterAction']);
7 Vendor mako\http\routing\Dispatcher->executeController()
Location: /var/www/hbrutvikling/hbr/vendor/mako/framework/src/mako/http/routing/Dispatcher.php on line 319.
313

314
		if($action instanceof Closure)
315
		{
316
			return $this->executeClosure($action, $parameters);
317
		}
318

319
		return $this->executeController($action, $parameters);
320
	}
321

322
	/**
323
	 * Dispatches the route and returns the response.
324
	 *
325
	 * @param  \mako\http\routing\Route $route Route
6 Vendor mako\http\routing\Dispatcher->executeAction()
Location: /var/www/hbrutvikling/hbr/vendor/mako/framework/src/mako/http/routing/Dispatcher.php on line 334.
328
	public function dispatch(Route $route): Response
329
	{
330
		$onion = new Onion($this->container, null, MiddlewareInterface::class);
331

332
		$this->addMiddlewareToStack($onion, [...$this->globalMiddleware, ...$route->getMiddleware()]);
333

334
		return $onion->peel(fn () => $this->executeAction($route), [$this->request, $this->response]);
335
	}
336
}
337
5 Vendor mako\http\routing\Dispatcher->mako\http\routing\{closure}()
Location: /var/www/hbrutvikling/hbr/vendor/mako/framework/src/mako/onion/Onion.php on line 125.
119
	protected function buildCoreClosure(object $object): Closure
120
	{
121
		return function (...$arguments) use ($object)
122
		{
123
			$callable = $object instanceof Closure ? $object : [$object, $this->method];
124

125
			return $callable(...$arguments);
126
		};
127
	}
128

129
	/**
130
	 * Builds a layer closure.
131
	 *
4 Vendor mako\onion\Onion->mako\onion\{closure}()
Location: /var/www/hbrutvikling/hbr/vendor/mako/framework/src/mako/onion/Onion.php on line 201.
195
		{
196
			$middleware = $this->middlewareFactory($layer, $middlewareParameters);
197

198
			$next = $this->buildLayerClosure($middleware, $next);
199
		}
200

201
		return $next(...$parameters);
202
	}
203
}
204
3 Vendor mako\onion\Onion->peel()
Location: /var/www/hbrutvikling/hbr/vendor/mako/framework/src/mako/http/routing/Dispatcher.php on line 334.
328
	public function dispatch(Route $route): Response
329
	{
330
		$onion = new Onion($this->container, null, MiddlewareInterface::class);
331

332
		$this->addMiddlewareToStack($onion, [...$this->globalMiddleware, ...$route->getMiddleware()]);
333

334
		return $onion->peel(fn () => $this->executeAction($route), [$this->request, $this->response]);
335
	}
336
}
337
2 Vendor mako\http\routing\Dispatcher->dispatch()
Location: /var/www/hbrutvikling/hbr/vendor/mako/framework/src/mako/application/web/Application.php on line 50.
44
		// Route the request
45

46
		$route = $this->container->get(Router::class)->route($request);
47

48
		// Dispatch the request and send the response
49

50
		$this->container->get(Dispatcher::class)->dispatch($route)->send();
51
	}
52
}
53
1 Vendor mako\application\web\Application->run()
Location: /var/www/hbrutvikling/hbr/index.php on line 10.
4

5
/**
6
 * Require init file and run the application.
7
 */
8
include __DIR__ . '/app/init.php';
9

10
Application::start(MAKO_APPLICATION_PATH)->run();
11
os Linux hbr3.nr.no 5.15.0-1039-azure #46-Ubuntu SMP Mon May 22 15:18:07 UTC 2023 x86_64
server time 2024-03-19 08:56:51 UTC
$_SERVER
  • DB_USERNAME

    (9) "hbrremote"
    

  • DB_PASSWORD

    (7) "99hbr00"
    

  • MODE

    (3) "DEV"
    

  • HTTP_ACCEPT

    (3) "*/*"
    

  • HTTP_USER_AGENT

    (9) "claudebot"
    

  • HTTP_HOST

    (10) "hbr2.nr.no"
    

  • PATH

    (70) "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin"
    

  • SERVER_SIGNATURE

    (71) "<address>Apache/2.4.54 (Ubuntu) Server at hbr2.nr.no Port 80</address>\n"
    

  • SERVER_SOFTWARE

    (22) "Apache/2.4.54 (Ubuntu)"
    

  • SERVER_NAME

    (10) "hbr2.nr.no"
    

  • SERVER_ADDR

    (13) "156.116.18.11"
    

  • SERVER_PORT

    (2) "80"
    

  • REMOTE_ADDR

    (12) "100.25.40.11"
    

  • DOCUMENT_ROOT

    (9) "/var/www/"
    

  • REQUEST_SCHEME

    (4) "http"
    

  • CONTEXT_PREFIX

    ""
    

  • CONTEXT_DOCUMENT_ROOT

    (9) "/var/www/"
    

  • SERVER_ADMIN

    (19) "webmaster@localhost"
    

  • SCRIPT_FILENAME

    (35) "/var/www/hbrutvikling/hbr/index.php"
    

  • REMOTE_PORT

    (5) "38496"
    

  • GATEWAY_INTERFACE

    (7) "CGI/1.1"
    

  • SERVER_PROTOCOL

    (8) "HTTP/1.1"
    

  • REQUEST_METHOD

    (3) "GET"
    

  • QUERY_STRING

    ""
    

  • REQUEST_URI

    (32) "/hbrutvikling/hbr/index.php/home"
    

  • SCRIPT_NAME

    (27) "/hbrutvikling/hbr/index.php"
    

  • PATH_INFO

    (5) "/home"
    

  • PATH_TRANSLATED

    (13) "/var/www/home"
    

  • PHP_SELF

    (32) "/hbrutvikling/hbr/index.php/home"
    

  • REQUEST_TIME_FLOAT

    1710838611.1514
    

  • REQUEST_TIME

    1710838611
    

No database connections have been established.