Module mochiweb_cookies

HTTP Cookie parsing and generating (RFC 2109, RFC 2965).

Copyright © 2007 Mochi Media, Inc.

Authors: Emad El-Haraty (emad@mochimedia.com).

Description

HTTP Cookie parsing and generating (RFC 2109, RFC 2965).

Data Types

header()

header() = {Name::string(), Value::string()}

proplist()

proplist() = [{Key::string(), Value::string()}]

Function Index

cookie/2cookie(Key, Value, []).
cookie/3Generate a cookie string based from the Key Value and Options Options should be a proplist of various cookie attributes to set returns a tuple {"Set-Cookie", string()}.
parse_cookie/1Parse the value of a Cookie header, ignoring cookie attributes, and return a simple property list.
test/0Run tests for mochiweb_cookies.

Function Details

cookie/2

cookie(Key::string(), Value::string()) -> header()

cookie(Key, Value, []).

cookie/3

cookie(Key::string(), Value::string(), Options::proplist()) -> header()

Generate a cookie string based from the Key Value and Options Options should be a proplist of various cookie attributes to set returns a tuple {"Set-Cookie", string()}. The option Max-Age (max_age) expects an integer indicating the number of seconds the cookie should expire in.

parse_cookie/1

parse_cookie(Cookie::string()) -> [{K::string(), V::string()}]

Parse the value of a Cookie header, ignoring cookie attributes, and return a simple property list.

test/0

test() -> ok

Run tests for mochiweb_cookies.


Generated by EDoc, Aug 9 2007, 13:31:11.