Skip to content

Commit

Permalink
feat: add session config (not yet linked)
Browse files Browse the repository at this point in the history
  • Loading branch information
mychidarko committed Jan 3, 2025
1 parent 842dcc6 commit c9cb18a
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2023 Michael Darko-Duodu
Copyright (c) 2025 Michael Darko-Duodu

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 2 additions & 0 deletions src/App.php
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,8 @@ public function csrf($options = [])
\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.');
}

Config::set('session', true);

if (!Anchor\CSRF::token()) {
Anchor\CSRF::config($options);
Anchor\CSRF::init();
Expand Down
3 changes: 3 additions & 0 deletions src/Config.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ class Config
'log.file' => 'app.log',
'log.open' => true,
'mode' => 'development',
'session' => true,
'session.lifetime' => 60 * 60 * 24,
'session.cookie' => ['secure' => false, 'httponly' => true, 'samesite' => 'lax'],
'scripts' => [],
'views.path' => null,
'views.cachePath' => null,
Expand Down

0 comments on commit c9cb18a

Please sign in to comment.