Skip to content

Instantly share code, notes, and snippets.

@ngaranko
Created December 26, 2013 19:28
Show Gist options
  • Save ngaranko/8137655 to your computer and use it in GitHub Desktop.
Save ngaranko/8137655 to your computer and use it in GitHub Desktop.
get session_id in filter
filter_get_session_id(RequestContext) ->
%% Get session_id from requestContext or Cookies
case proplists:get_value(session_id, RequestContext) of
undefined ->
%% Try loading session_id from request, using boss_web_controller
boss_web_controller:generate_session_id(proplists:get_value(request, RequestContext));
SessionID ->
SessionID
end.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment