anchor.diff:      State#user_state{metadata = Metadata ++ State#user_state.metadata}.
   
   handle_timeout(Name, State) ->
  -    %% TODO Define Name as a temporary metadata.
  -    handle(Name, State#user_state.timeout_handlers, State).
  -
  -handle_event(Name, Args, State) ->
  -    %% TODO Define Name & Args as a temporary metadata.
  -    handle(Name, State#user_state.event_handlers, State).
  +    with_tmp_metadata([{<<"timer">>, Name}],
  +                      fun(S) ->
  +                              handle(Name, S#user_state.timeout_handlers, S)
  +                      end,
  +                      State).
  +
  +handle_event(Event, Name, Args, State) ->
  +    %% FIXME Name and Args should be strings.
  +    with_tmp_metadata([{<<"event">>, Event}, {<<"event.name">>, Name}, {<<"event.args">>, Args}],
  +                      fun(S) ->
  +                              handle(Name, S#user_state.event_handlers, S)
  +                      end,
  +                      State).
   
   handle_socketio(SIOMessages, State) when is_list(SIOMessages) ->
       lists:foldr(fun(_, {stop, Reason, NewState}) ->
  
positive.code: -module(flood_session).
  
  -export([init/2, run/2, dispatch/3, handle_socketio/2, handle_event/3, handle_timeout/2, add_metadata/2, get_metadata/2]).
  -export([sample_session/0]).
  
  -record(user_state, {metadata,
  
negative.code:                 {noreply, State},
                  SIOMessages);
  
  handle_socketio(SIOMessage = #sio_message{type = event, endpoint = Endpoint, data = Data}, State) ->
      %% TODO Add acks.
      with_tmp_metadata([{<<"message">>, SIOMessage},
                         {<<"message.opcode">>, sio_opcode(event)},
                         {<<"message.endpoint">>, Endpoint},
                         {<<"message.data">>, Data}],
                        fun(S) ->
                                JSON = jsonx:decode(Data, [{format, proplist}]),
                                Name = proplists:get_value(<<"name">>, JSON),
                                Args = proplists:get_value(<<"args">>, JSON),
                                case handle(sio_opcode(event), S#user_state.socketio_handlers, S) of
                                    {stop, Reason, NewState}    -> {stop, Reason, NewState};
                                    Else = {noreply, NewState}  -> combine(handle_event(Data, Name, Args, NewState), Else);
                                    Else = {reply, _, NewState} -> combine(handle_event(Data, Name, Args, NewState), Else)
                                end
                        end,
                        State);
  
  handle_socketio(SIOMessage = #sio_message{type = Type, endpoint = Endpoint, data = Data}, State) ->
      %% TODO Add acks.
      with_tmp_metadata([{<<"message">>, SIOMessage},
                         {<<"message.opcode">>, sio_opcode(Type)},
                         {<<"message.endpoint">>, Endpoint},
                         {<<"message.data">>, Data}],
                        fun(S) ->
                                handle(sio_opcode(Type), S#user_state.socketio_handlers, S)
                        end,
                        State).
  
  %% Internal functions:
  handle(Name, Handlers, State) ->
  