def channel_and_http_session(func):
 @http_session
 @channel_session
 @functools.wraps(func)
 def inner(message, *args, **kwargs):
  if ((message.http_session is not None) and (settings.SESSION_COOKIE_NAME not in message.channel_session)):
   message.channel_session[settings.SESSION_COOKIE_NAME] = message.http_session.session_key
  elif ((message.http_session is None) and (settings.SESSION_COOKIE_NAME in message.channel_session)):
   session_engine = import_module(settings.SESSION_ENGINE)
   session = session_engine.SessionStore(session_key=message.channel_session[settings.SESSION_COOKIE_NAME])
   message.http_session = session
  return func(message, *args, **kwargs)
 return inner

def channel_and_http_session ( func ) : @ http_session @ channel_session @ functools . wraps ( func ) def inner ( message , * args , ** kwargs ) : if ( ( message . http_session is not None ) and ( settings . SESSION_COOKIE_NAME not in message . channel_session ) ) : message . channel_session [ settings . SESSION_COOKIE_NAME ] = message . http_session . session_key elif ( ( message . http_session is None ) and ( settings . SESSION_COOKIE_NAME in message . channel_session ) ) : session_engine = import_module ( settings . SESSION_ENGINE ) session = session_engine . SessionStore ( session_key = message . channel_session [ settings . SESSION_COOKIE_NAME ] ) message . http_session = session return func ( message , * args , ** kwargs ) return inner
enables both the channel_session and http_session .