def METHOD_NAME(sessions_key=None):
    portal = api.portal.get()
    portal_path = '-'.join(portal.getPhysicalPath()[1:])
    if not sessions_key:
        sessions_key = '%s-session-*' % portal_path
    cclient = cache.get_client()
    sessions = []
    try:
        keys = cclient.client.keys(sessions_key)
        if keys:
            for session in cclient.client.mget(keys):
                try:
                    session = cPickle.loads(session)
                except Exception:
                    continue
                sessions.append(session)
            sessions = reversed(sorted(sessions, key=lambda x: x['updated']))
    except AttributeError:
        sessions = []
    # we'll also squash and cleanup duplicate sessions here...
    found = []
    filtered = []
    for session in sessions:
        compare_key = '%s%s%s' % (
            session.get('ua'),
            session.get('ip'),
            session.get('userid')
        )
        if compare_key in found:
            cache_key = '%s-session-%s-%s' % (
                portal_path,
                session['userid'],
                session['id']
            )
            try:
                cache.delete(cache_key)
            except Exception:
                pass
        else:
            try:
                session['user'] = api.user.get(session['userid'])
            except Exception:
                pass
            found.append(compare_key)
            filtered.append(session)
    return filtered