Plug.Conn.Cookies

Plug.Conn.Cookies

Conveniences for encoding and decoding cookies.

Summary

Functions

decode(cookie)

Decodes the given cookies as given in a request header

encode(key, opts \\ %{})

Encodes the given cookies as expected in a response header

Functions

decode(cookie)

Decodes the given cookies as given in a request header.

If a cookie is invalid, it is automatically discarded from the result.

Examples

iex> decode("key1=value1, key2=value2")
%{"key1" => "value1", "key2" => "value2"}

encode(key, opts \\ %{})

Encodes the given cookies as expected in a response header.

© 2013 Plataformatec
Licensed under the Apache License, Version 2.0.
https://hexdocs.pm/plug/Plug.Conn.Cookies.html

在线笔记
App下载
App下载

扫描二维码

下载编程狮App

公众号
微信公众号

编程狮公众号

意见反馈
返回顶部