---
title: "Tomcat的Session设置 "
author: "123003473"
date: "2012-11-24T00:37:00Z"
tags: []
categories: ["开源软件"]
slug: "tomcat-session"
draft: false
lastmod: "2012-11-24T00:37:00Z"
id: 1734305
url: "https://hck.iteye.com/blog/1734305"
---

1、为单个WEB设置SESSION 在WEB.XML中添加 xml 代码 \[code="java"] 1. 2. 3. 15//单位为分钟 4. 5.\[/code] 2、为单个Servlet指定会话超时时间 xml 代码 \[code="java"] 1. 2. Servlet名称 3. Servlet类路径 4. 5. timeout 6. 600 7. 8. \[/code] 当Servlet与默认时间不同且大于-2时，以Servlet时间为准 1、为所有WEB设置SESSION 在\\CONF\\WEB.XMLWEB.XML中添加 xml 代码 \[code="java"] 1. 2. 3. 15//单位为分钟 4. 5.\[/code] 【转载地址】http://mqzsweet.iteye.com/blog/141938