Skip to content

Commit c9cb18a

Browse files
committed
feat: add session config (not yet linked)
1 parent 842dcc6 commit c9cb18a

File tree

3 files changed

+6
-1
lines changed

3 files changed

+6
-1
lines changed

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2023 Michael Darko-Duodu
3+
Copyright (c) 2025 Michael Darko-Duodu
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

src/App.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,8 @@ public function csrf($options = [])
203203
\trigger_error('CSRF module not found! Run `leaf install csrf` or `composer require leafs/csrf` to install the CSRF module. This is required to configure CSRF.');
204204
}
205205

206+
Config::set('session', true);
207+
206208
if (!Anchor\CSRF::token()) {
207209
Anchor\CSRF::config($options);
208210
Anchor\CSRF::init();

src/Config.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@ class Config
2828
'log.file' => 'app.log',
2929
'log.open' => true,
3030
'mode' => 'development',
31+
'session' => true,
32+
'session.lifetime' => 60 * 60 * 24,
33+
'session.cookie' => ['secure' => false, 'httponly' => true, 'samesite' => 'lax'],
3134
'scripts' => [],
3235
'views.path' => null,
3336
'views.cachePath' => null,

0 commit comments

Comments
 (0)