-/*
- * 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)
-{
- session_unlock(session);
- new_uuid(session->token);
- session_update_expiration(session, NOW);
- afb_hook_session_renew(session);
- session_unlock(session);
-}
-