import requests
import json


def login(email, password):
    """Login to Fleep, return session information"""
    response = requests.post(
        "https://fleep.io/api/account/login",
        headers={"Content-Type": "application/json"},
        data=json.dumps({"email": email, "password": password})
        )
    if response.status_code is not 200:
        return False
    data = response.json()
    return {
        'ticket': data["ticket"],
        'token_id':response.cookies["token_id"],
        'display_name': data['display_name']
    }