Return-Path: Delivered-To: apmail-myfaces-users-archive@www.apache.org Received: (qmail 60496 invoked from network); 28 Feb 2006 18:20:27 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 28 Feb 2006 18:20:27 -0000 Received: (qmail 46162 invoked by uid 500); 28 Feb 2006 18:20:14 -0000 Delivered-To: apmail-myfaces-users-archive@myfaces.apache.org Received: (qmail 46082 invoked by uid 500); 28 Feb 2006 18:20:14 -0000 Mailing-List: contact users-help@myfaces.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "MyFaces Discussion" Delivered-To: mailing list users@myfaces.apache.org Received: (qmail 46016 invoked by uid 99); 28 Feb 2006 18:20:13 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 28 Feb 2006 10:20:13 -0800 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: domain of mkienenb@gmail.com designates 64.233.182.201 as permitted sender) Received: from [64.233.182.201] (HELO nproxy.gmail.com) (64.233.182.201) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 28 Feb 2006 10:20:00 -0800 Received: by nproxy.gmail.com with SMTP id m18so479450nfc for ; Tue, 28 Feb 2006 10:19:38 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=hIKa5MXyVdXYwRDdcrhYnz2S9YsNZlJqu3vK05vfsPhlhW+pBJqWirq0BZ7AJwiDolitkk9vkcot5z3l04FK0CBr7mJoaRt7NzZPx3UdIxhflgGmT+b3RIKX2hRrbWjqQnB38IyEcg7BDWx7ROOr5214zgOYcdEg/Y3LRHLs3rw= Received: by 10.49.41.4 with SMTP id t4mr667594nfj; Tue, 28 Feb 2006 10:19:38 -0800 (PST) Received: by 10.48.48.17 with HTTP; Tue, 28 Feb 2006 10:19:38 -0800 (PST) Message-ID: <8f985b960602281019q786c1532p272d36a85ed5e30c@mail.gmail.com> Date: Tue, 28 Feb 2006 13:19:38 -0500 From: "Mike Kienenberger" To: "MyFaces Discussion" Subject: Re: Session Expiration Default Target? In-Reply-To: <44044B70.2060208@parkplatz.net> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline References: <67538F65C12991418BE2801290008A070230F6BE@ilnort1msgusr15.ITServices.sbc.com> <8f985b960602271811s779ba770g7581d9469599fc58@mail.gmail.com> <44044B70.2060208@parkplatz.net> X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N > > On 2/27/06, Elam Daly wrote: > >>how do I determine if a session has expired? > Mike Kienenberger wrote: > > You have to do something like this: > > > > boolean expired =3D false; > > try > > { > > session.getAttribute("anything"): > > expired =3D false; > > } > > catch (IllegalStateException e) > > { > > expired =3D true; > > } On 2/28/06, Jonathan Harley wrote: > No, in a filter you can just call session.isNew() That would be incorrect, although you could possibly replace getAttribute() with isNew() in the code above. public abstract boolean isNew() A session is considered to be "new" if it has been created by the server, but the client has not yet acknowledged joining the session. For example, if the server supported only cookie-based sessions and the client had completely disabled the use of cookies, then calls to HttpServletRequest.getSession() would always return "new" sessions. Returns: true if the session has been created by the server but the client has not yet acknowledged joining the session; false otherwise Throws: IllegalStateException if an attempt is made to access session data after the session has been invalidated