session_cookie | R Documentation |
A session cookie is just like any other cookie, but reqres treats this one
different, parsing it's value and making it available in the $session
field. However, the same settings as any other cookies applies and can be
given during request initialisation using this function.
session_cookie(
name = "reqres",
expires = NULL,
max_age = NULL,
path = NULL,
secure = NULL,
same_site = NULL
)
is_session_cookie_settings(x)
name |
The name of the cookie |
expires |
A POSIXct object given the expiration time of the cookie |
max_age |
The number of seconds to elapse before the cookie expires |
path |
The URL path this cookie is related to |
secure |
Should the cookie only be send over https |
same_site |
Either |
x |
An object to test |
A session_cookie_settings
object that can be used during request
initialisation. Can be cached and reused for all requests in a server
As opposed to regular cookies the session cookie is forced to be HTTP only which is why this argument is missing.
session_cookie <- session_cookie()
rook <- fiery::fake_request("http://example.com")
# A key must be provided for session_cookie to be used
Request$new(rook, key = random_key(), session_cookie = session_cookie)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.