-
-
Notifications
You must be signed in to change notification settings - Fork 152
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New option httpOnly = "signature" #89
Comments
Yea, I think this makes sense. There are likely several different attributes that one may like to be separate between the two cookies, like |
I've created a new branch in which The old |
This would also be useful for me, to avoid needless round trips to the server to get info that is already in the cookie. I wonder if there is any use case where the signature cookie should not be httpOnly? It is only useful to code that knows the secret, and if that code runs on the client then the signing seems useless. |
@BertoldVdb, it's also difficult for me to find a use for both the cookie and its signature readable from javascript. Perhaps this argument can be used to simplify the interface. Make httpOnly a boolean that makes the cookie readable, while the signature is always httpOnly. |
This is what I do at the moment in a privately patched version. I can submit a pull request if you want. |
I encourage you to do so, let's see find out what maintainers think. |
Being able to set/unset the HttpOnly attribute for the signature cookie independently would also make it a lot easier to implement "offline logout" (invalidating a session when the server is unreachable), by deleting one of the cookies in browser-side JS, without having to compromise security more than necessary. In my case I'd probably want the session cookie to be HttpOnly and the signature cookie not, but there are probably arguments for the opposite (like in the OP), so both possibilities would be welcome. |
Hi,
I think it would be useful to have a new option for signed cookies such that the cookie is
httpOnly = false
but the signature ishttpOnly = true
. The case for this are Single Page Apps(SPA).httpOnly = true
).I propose to create a new option,
httpOnly = "signature"
, to achieve this. A quick way to implement this feature is this javiertury@ffda6e4Note that I've used the weak comparison(==) operator.
EDIT: Better implementation
The text was updated successfully, but these errors were encountered: