thesuffocated
The documentation for Plug.Conn.delete_resp_cookie/3 merely mentions that the function “deletes a response cookie” without further explanation. What does the function actually do?
Suppose I write delete_resp_cookies(conn, :dummy). The documentation seems to suggest that the item with key :dummy will be removed from the map conn.resp_cookies. However, looking at the implementation code, apparently what the function does is the opposite: it puts an item with key :dummy into conn.resp.cookies and set its max_age to zero (with respect to the beginning of 1970-01-01).
It seems that by calling delete_resp_cookies(conn, :dummy), the server will tell the browser to mark the cookie “dummy” as already expired, thus this looks more like a hint to the browser that the cookie shall be removed. Am I correct?
Trending in Questions
Other Trending Topics
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #library
- #deployment
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #elixirconf
- #channels
- #exunit
- #discussion
- #code-sync
- #podcasts
- #javascript
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #ai
- #elixirconf-us
- #blog-post
- #elixir-ls
- #phoenix_html
- #iex
- #graphql
- #genstage
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #elixirconf-eu
- #metaprogramming
- #hex










Showing Posts 1 to 1- Show Best Posts
- Show All (oldest first)
- Show All (newest first)
LostKobrakai
That’s correct. The server is only telling the browser what to do, but the browser is responsible for managing it’s cookies.