This repository was archived by the owner on Jun 24, 2025. It is now read-only.
feat: allow setting custom cookiePath#1155
Merged
eliandoran merged 4 commits intodevelopfrom Feb 10, 2025
Merged
Conversation
defaults to "/" as previously set by default options
eliandoran
reviewed
Feb 10, 2025
config-sample.ini
Outdated
| trustedReverseProxy=false | ||
|
|
||
|
|
||
| [Cookies] |
Contributor
There was a problem hiding this comment.
I think it would make more sense to have Session instead of Cookies? Since we are explicitly configuring the session cookie and not other potential cookies we might have (for example the one which stores if we are on mobile or desktop view).
Contributor
Author
There was a problem hiding this comment.
I suppose you're right (althought technically I will need to use the same path for the csrf cookie, but that also kinda has something to do with sessions ;-) ), will change accordingly :-)
as requested in PR #1155
7e9e896 to
62f8f8f
Compare
eliandoran
approved these changes
Feb 10, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hi,
this PR will allow users to set a custom cookiePath, if they require it (see TriliumNext/Trilium#5473 and the comment in the config-sample.ini for further info on why this might be needed).
I've added a new "Cookies" section, because goal is to also allow e.g. the user to set a custom cookie expiration time, which will be a separate PR, but will go into the same config section.
closes TriliumNext/Trilium#5473
(still in draft, as I need to do a tiny test with the CSRF cookie as well, and requests to the API as well)
edit:
There also seems to be an issue with completely new instances, where there is no existing cookie set yet – it currently crashes, because it seems the req.session prop is undefined, when setting the path to anything other than "" or "/"edit2: ignore the above edit, that was partially a stupid mistake on end running my local dev instance :-)