Hi,
to create a user-session you may try the following code in the doGet
(...)/doPost (...) - handling-Methods :
HttpSession oSession = roRequest.getSession (false); // try to get an
exisiting session
if (oSession != null)
{
// OK, anyone is been connected for the n-th time
// continue ....
performTask (....)
}
else
{
// - user tries to connect the first time, no cookie on the client
-> no session
// - sessiontimeout, all userdata are lost
// this behaviour occurs too if you use an clustered webserver since
all sessiondata residents only on one machine (!!!)
// you can't determine, why the session is invalid
oSession = roRequest.getSession (true); // get a new session
without any attributes in
// perhaps an errormessage or a login-handling or both
} :
All user-sessions will be invalidated by tomcat automatically. The timeout is
defined in the WEB.XML in your %TOMCAT_HOME%/conf - Directory. Out-of-the-box
this parameter is initialized with 30. This means, after approximately 30
Minutes the user-session will be invalidated. The next HTTP-Request will run
into the ELSE-case described above. Try any other values :-)
venkatesan <[EMAIL PROTECTED]> am 15.02.2001 12:10:14
Bitte antworten an [EMAIL PROTECTED]
An: [EMAIL PROTECTED]
Kopie: (Blindkopie: Ralf Bode/13/LBSH/DE)
Thema: session creation?
Hi All,
I am creating web applications using servlets. can anybody tell
that simple session creation for a particular user and invalidate after
a specific time.
Thanks
cheers
venkatesh
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]