diff options
Diffstat (limited to 'examples/cookie')
-rw-r--r-- | examples/cookie/src/toppage_handler.erl | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/examples/cookie/src/toppage_handler.erl b/examples/cookie/src/toppage_handler.erl index 6af8dcc..9a67cb1 100644 --- a/examples/cookie/src/toppage_handler.erl +++ b/examples/cookie/src/toppage_handler.erl @@ -5,17 +5,17 @@ -export([init/2]). -init(Req, Opts) -> +init(Req0, Opts) -> NewValue = integer_to_list(rand:uniform(1000000)), - Req2 = cowboy_req:set_resp_cookie(<<"server">>, NewValue, - #{path => <<"/">>}, Req), + Req1 = cowboy_req:set_resp_cookie(<<"server">>, NewValue, + #{path => <<"/">>}, Req0), #{client := ClientCookie, server := ServerCookie} = cowboy_req:match_cookies([{client, [], <<>>}, {server, [], <<>>}], Req2), {ok, Body} = toppage_dtl:render([ {client, ClientCookie}, {server, ServerCookie} ]), - cowboy_req:reply(200, #{ + Req = cowboy_req:reply(200, #{ <<"content-type">> => <<"text/html">> - }, Body, Req2), - {ok, Req2, Opts}. + }, Body, Req1), + {ok, Req1, Opts}. |