---
title: "关于session的生命周期"
author: "eagletony"
date: "2011-02-10T10:36:46Z"
tags: []
categories: ["编程语言"]
slug: "session"
draft: false
lastmod: "2011-02-10T10:36:46Z"
id: 902536
url: "https://eagletony.iteye.com/blog/902536"
---

在Web开发的过程中有时需要将一些变量值存入session中，session的生命周期是有时间的一般默认是30分钟。如果你需要保存的变量需要存在的时间超过30分钟以上可以更改session的生命周期时间。在tomcat中更改 conf\web.xml  
 <session-config>
        <session-timeout>30</session-timeout>
 </session-config>  
中timeout的值。