English 中文(简体)
Tomcat Unique Session Id
原标题:Tomcat Unique SessionId
  • 时间:2011-10-04 15:44:31
  •  标签:
  • java
  • tomcat

Is there any way to configure(xml) tomcat (6.x) to generate unique SessionId. (Without extending ManagerBase/StandardManager).

最佳回答

我正在把用户标识详细情况记录在db表中,Id在一栏中,有独一无二的制约因素,正在成为独一无二的制约因素

您不应把托马托克式会议作为非银的一个独特制约因素。 这毫无意义。 Tomcat s session ID只是所有现行工作会议的独特之处。 “Serlet spec”在某个时候、数月或数年后,不得再利用已过期届会的ID,举行新的会议。 单体长度为32-char hexadecimal string as session ID,所有可能的识别器都不得“无限制”。 在某些情况下,你可以阻止它被重新用于另一个客户。

I do not understand why you would ever store a Tomcat-generated session ID in the DB lifetime long. You should remove it from the DB whenever it has expired. Or you should solve your problem differently. As you didn t state anything about the functional requirement behind this "solution", I cannot give a more suited answer. Here are however some hints:

  • 另一种方式是:在行文中插入或选择必要的数据,获取亚洲开发银行生成的ID,并将其作为<代码>的属性加以储存。 HttpSession。 例如,挂号用户索引,即整个<代码>。 用户物体。

  • 或者,如果需要扩大届会的缺省寿命,例如 “拯救我”方案,然后,你应产生“UUID yourself”(如果在非银中确实存在 t,则进行测试),而是用另外的 co。

问题回答

我是自己处理这个问题的,我要提到,利用UUID,利用128个轨道(32个六位数)形成一个有保障的独一无二的国际发展法。 它基于UTC的时间,只要生成不同UUID的利用时间点不同,就保证是独一无二的。

另见RFC4122:

Java has a standard class for generating these IDs:
http://docs.oracle.com/javase/6/docs/api/java/util/UUID.htm

仅使用一个复合的主要钥匙,如“SID”、Datum;





相关问题
Spring Properties File

Hi have this j2ee web application developed using spring framework. I have a problem with rendering mnessages in nihongo characters from the properties file. I tried converting the file to ascii using ...

Logging a global ID in multiple components

I have a system which contains multiple applications connected together using JMS and Spring Integration. Messages get sent along a chain of applications. [App A] -> [App B] -> [App C] We set a ...

Java Library Size

If I m given two Java Libraries in Jar format, 1 having no bells and whistles, and the other having lots of them that will mostly go unused.... my question is: How will the larger, mostly unused ...

How to get the Array Class for a given Class in Java?

I have a Class variable that holds a certain type and I need to get a variable that holds the corresponding array class. The best I could come up with is this: Class arrayOfFooClass = java.lang....

SQLite , Derby vs file system

I m working on a Java desktop application that reads and writes from/to different files. I think a better solution would be to replace the file system by a SQLite database. How hard is it to migrate ...

热门标签