Skip to main content

session_cookie_value

Function session_cookie_value 

Source
pub fn session_cookie_value(
    data: &Table,
    name: &str,
    secret: &str,
    max_age: Option<i64>,
) -> Result<String>
Expand description

The value session:save would write for data: the JSON payload (with the expiry when max_age is set) signed for name — so a test can put a session into a client’s jar without a login round trip.

§Errors

The same as session:save: a secret under 16 bytes, reserved keys, values that are not JSON, or a payload over the cookie bound.