anchor.diff:  redirect_test() ->
       Redirect = <<"https://localhost/back">>,
       BadRedirect = "https://localhost/back",
  -    {ok, Pid} = tts_session:start(?ID),
  +    {ok, Pid} = tts_session:start_link(?ID),
       ok = tts_session:set_used_redirect(Redirect, Pid),
       {ok,Redirect} = tts_session:get_used_redirect(Pid),
       ignored = tts_session:set_used_redirect(BadRedirect, Pid),
  
positive.code: same_ua_ip_test() ->
      IP = {123,123,123,123},
      UA = <<"some browser">>,
      {ok, Pid} = tts_session:start(?ID),
      true = tts_session:is_user_agent(UA,Pid),
      false = tts_session:is_user_agent(IP,Pid),
      true = tts_session:is_user_agent(UA,Pid),
  
negative.code:     end.
  
  get_set_max_age_test() ->
      {ok, Pid} = tts_session:start_link(?ID),
      %set up the mocking of tts_session_mgr
      CloseFun = fun(ID) ->
                         ID = ?ID,
                         tts_session:close(Pid)
                 end,
      ok = meck:new(tts_session_mgr),
      ok = meck:expect(tts_session_mgr,session_wants_to_close, CloseFun),
      {ok, _} = tts_session:get_max_age(Pid),
      ok = tts_session:set_max_age(1000,Pid),
      {ok, 1000} = tts_session:get_max_age(Pid),
      ok = tts_session:set_max_age(1,Pid),
      timer:sleep(5),
      try tts_session:get_id(Pid) of
          _ -> erlang:error(not_stopped)
  