public static Cookie encodeCookie(SessionInfo info) {
        // create a cookie using the configuration information
        HttpSession session = info.getSession();
        SessionConfig config = info.getSessionConfig();
        Cookie cookie = new Cookie(
                        config.getIDName(),
                        config.getSessionVersion() + session.getId());
        cookie.setSecure(config.isCookieSecure());
        cookie.setMaxAge(config.getCookieMaxAge());
        cookie.setPath(config.getCookiePath());
        cookie.setDomain(config.getCookieDomain());

        return cookie;
    }
public static Cookie encodeCookie ( SessionInfo info ) { HttpSession session = info . getSession ( ) ; SessionConfig config = info . getSessionConfig ( ) ; Cookie cookie = new Cookie ( config . getIDName ( ) , config . getSessionVersion ( ) + session . getId ( ) ) ; cookie . setSecure ( config . isCookieSecure ( ) ) ; cookie . setMaxAge ( config . getCookieMaxAge ( ) ) ; cookie . setPath ( config . getCookiePath ( ) ) ; cookie . setDomain ( config . getCookieDomain ( ) ) ; return cookie ; }
Create a proper Cookie for the given session object.

@param info
@return Cookie