You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@couchdb.apache.org by GitBox <gi...@apache.org> on 2021/12/09 23:31:07 UTC

[GitHub] [couchdb] rnewson opened a new pull request #3869: Always send all cookie attributes

rnewson opened a new pull request #3869:
URL: https://github.com/apache/couchdb/pull/3869


   ## Overview
   
   Send all the cookie attributes whenever we send a cookie. Only the value of AuthSession varies.
   
   ## Testing recommendations
   
   <!-- Describe how we can test your changes.
        Does it provides any behaviour that the end users
        could notice? -->
   
   ## Related Issues or Pull Requests
   
   <!-- If your changes affects multiple components in different
        repositories please put links to those issues or pull requests here.  -->
   
   ## Checklist
   
   - [ ] Code is written and works correctly
   - [ ] Changes are covered by tests
   - [ ] Any new configurable parameters are documented in `rel/overlay/etc/default.ini`
   - [ ] A PR for documentation changes has been made in https://github.com/apache/couchdb-documentation
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@couchdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [couchdb] rnewson merged pull request #3869: Always send all cookie attributes

Posted by GitBox <gi...@apache.org>.
rnewson merged pull request #3869:
URL: https://github.com/apache/couchdb/pull/3869


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@couchdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [couchdb] rnewson commented on a change in pull request #3869: Always send all cookie attributes

Posted by GitBox <gi...@apache.org>.
rnewson commented on a change in pull request #3869:
URL: https://github.com/apache/couchdb/pull/3869#discussion_r766485886



##########
File path: src/couch/src/couch_httpd_auth.erl
##########
@@ -371,9 +371,18 @@ cookie_auth_cookie(Req, User, Secret, TimeStamp) ->
     mochiweb_cookies:cookie(
         "AuthSession",
         couch_util:encodeBase64Url(SessionData ++ ":" ++ ?b2l(Hash)),
-        [{path, "/"}] ++ cookie_scheme(Req) ++ max_age() ++ cookie_domain() ++ same_site()
+        cookie_attributes(Req)
     ).
 
+clear_auth_cookie(Req) ->
+    mochiweb_cookies:cookie(
+      "AuthSession", "", cookie_attributes(Req)
+     ).
+
+cookie_attributes(Req) ->
+    Attributes = [path(), http_only(), max_age(), cookie_scheme(Req), max_age(), cookie_domain(), same_site()],

Review comment:
       oops. fixed.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@couchdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [couchdb] rnewson merged pull request #3869: Always send all cookie attributes

Posted by GitBox <gi...@apache.org>.
rnewson merged pull request #3869:
URL: https://github.com/apache/couchdb/pull/3869


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@couchdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org