fix cookie; add cookie retrieving methods; add example