package com.house365.web.system.listener;

import javax.servlet.http.HttpSessionEvent;
import javax.servlet.http.HttpSessionListener;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.house365.rest.context.CmConstant;

/**
 * 系统创建session事件监听 〈功能详细描述〉
 * 
 */
public class SessionListener implements HttpSessionListener {
    /**
     * 日志记录器
     */
    private static final Logger LOGGER = LoggerFactory
            .getLogger(SessionListener.class);

    public void sessionCreated(HttpSessionEvent event) {
        // 设置默认城市为nj,默认用户为admin
       /* event.getSession().setAttribute(CmConstant.USER_NAME, "admin");
        event.getSession().setAttribute(CmConstant.CITY_ID, "nj");
        event.getSession().setAttribute("city", "nj");*/
        LOGGER.debug("session创建成功");
    }

    public void sessionDestroyed(HttpSessionEvent event) {
        LOGGER.debug("session销毁成功");
    }

}
