检测开发模式:为生产设置安全cookie,对开发模式设置不安全

时间:2011-09-12 05:07:20

标签: gwt

我正在使用GWT的Cookie.setCookie为我的网站设置登录cookie。我想让它们成为安全的cookie(我的网站总是运行在https上),但开发模式只能通过http运行。

设置交换机的最佳方法是什么,以便不安全的代码在devmode中运行,而安全代码在生产中运行?

1 个答案:

答案 0 :(得分:3)

GWT.isProdMode()

  /**
   * Returns <code>true</code> when running in production mode. Returns
   * <code>false</code> when running either in development mode, or when running
   * in a plain JVM.
   */
相关问题