Blasta/blasta/utilities/http.py

14 lines
419 B
Python
Raw Normal View History

#!/usr/bin/python
# -*- coding: utf-8 -*-
class UtilitiesHttp:
def is_jid_matches_to_session(accounts, sessions, request):
jabber_id = request.cookies.get('jabber_id')
session_key = request.cookies.get('session_key')
if (jabber_id and
jabber_id in accounts and
jabber_id in sessions and
session_key == sessions[jabber_id]):
return jabber_id