The session is created.
I create it with
session=req.getSession(true);
session.setMaxInactiveInterval(3600);
after a user has performed successfull login.
Then for his further requests I do
session=request.getSession(false);
if (session==null) => user not authorized because session is not valid anymore
else => get data from session and perform further action
If I test this 'session' will not be 'null': the session is created.
But it will only not be 'null' for subsequent requests that arrive not more than
about 10s apart!
But I set the MaxInactiveInterval to 1 hour (=3600s)??
> -----Original Message-----
> From: Duane Morse [SMTP:[EMAIL PROTECTED]]
> Sent: mardi 28 novembre 2000 19:02
> To: [EMAIL PROTECTED]
> Subject: Re: session maximum inactive interval
>
> Two possibilities come to mind.
>
> If the browser you're using doesn't support cookies, then you're creating a
> new
> session each time.
>
> The servlet container may be creating a new session each time just because
> you
> used "true" in getSession(), even though it is only supposed to create a new
> session
> if there isn't an existing one. That could be a bug in the servlet
> container, or
> there may be some other configuration problem with the servlet container
> that prevents
> it from saving sessions.
>
> You might want to call getSession() instead of getSession(true) to see if
> the container
> found an existing session when it was supposed to.
>
> Duane Morse, Eldorado Computing Inc., Phoenix AZ
>
>
> -----Original Message-----
> From: Bartsch Axel [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, November 28, 2000 10:29 AM
> To: [EMAIL PROTECTED]
> Subject: session maximum inactive interval
>
>
> Hi members,
>
> I am using a HTTPSession object running with cookies.
> I am setting the session maximum inactive interval to 1 hour by using the
> following code:
>
> session=req.getSession(true);
> session.setMaxInactiveInterval(3600);
>
> JAVA servlet API:
> public void setMaxInactiveInterval(int interval)
>
> Specifies the time, in seconds, between client requests before the
> servlet container will invalidate this session. A
> negative time indicates the session should never timeout.
> Parameters:
> interval - An integer specifying the number of seconds
>
> But when testing the session only stays alive for a couple of seconds: the
> maximum I achieved was 9 sec??
> and the alive time is not always the same.
>
> Does anybody know more about this and can help me?
>
>
>
> Axel, Lannion/France
>
> ___________________________________________________________________________
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
> of the message "signoff SERVLET-INTEREST".
>
> Archives: http://archives.java.sun.com/archives/servlet-interest.html
> Resources: http://java.sun.com/products/servlet/external-resources.html
> LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
>
> ___________________________________________________________________________
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
> of the message "signoff SERVLET-INTEREST".
>
> Archives: http://archives.java.sun.com/archives/servlet-interest.html
> Resources: http://java.sun.com/products/servlet/external-resources.html
> LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html