-/*
- * check whether the token of 'session' is 'token'
- * return 1 if true or 0 otherwise
- */
-int afb_session_check_token (struct afb_session *session, const char *token)
-{
- int r;
-
- session_unlock(session);
- r = !session->closed
- && session->expiration >= NOW
- && !(session->token[0] && strcmp (token, session->token));
- session_unlock(session);
- return r;
-}
-
-/* generate a new token and update client context */
-void afb_session_new_token (struct afb_session *session)
-{
- /* Old token was valid let's regenerate a new one */
- new_uuid(session->token);
-
- /* keep track of time for session timeout and further clean up */
- session_update_expiration(session, NOW);
-}
-