Great answer :!!!! thanks a lot !!!<br><br><br><div><span class="gmail_quote">2007/1/19, Bany, Michel &lt;<a href="mailto:mbany@cincom.com">mbany@cincom.com</a>&gt;:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
&gt; I have developped a Seaside application and I just want to<br>&gt; know how can I get the session which are currently active.<br><br>Hi Sylvain,<br><br>Not sure if I understand what you want exactly. You may want to try
<br>this.<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;WASession allInstances select: [ :each | each isActive ].<br><br>If you have subclassed WASession, you may want this.<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;WASession allGeneralInstances select: [ :each | each isActive ]
<br><br>or maybe this<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;MySessionClass allInstances select: [ :each | each isActive ]<br><br>The above will answer with a collection of session objects that are<br>active (=usable), i.e. sessions that can still be used from a browser.
<br><br><br>&gt; In fact when I opened my browser I see a new instance in (<br>&gt; MyWAComponent allInstances ).<br>&gt; But when I close my browser, this instance is not remove from<br>&gt; ( MyWAComponent allInstances ).
<br><br><br>When you close your browser, there is no impact at all on what objects<br>you have in your server image. As a matter of fact the browser does not<br>send anything to any server when it is closed. The same applies if you
<br>navigate away to a new url in your browser.<br><br><br>&gt; I see the WASession object but I don&#39;t find how to know if<br>&gt; the session has expired because when I get all the instances<br>&gt; of WASession which linked to my MyWAComponent, none of them
<br>&gt; are expired even if my browser is closed.<br><br>When you close your browser (or more generally when you stop using a<br>session, going for a cup of coffee or navigating away to another web<br>site),<br>the session is still around in the image and is still usable. For
<br>instance,<br>if you re-open the browser, it is possible to return to your most recent<br>sessions using the browser history. However if you wait too long before<br>returning to your session, it may have become unusable. This is the
<br>session<br>time out, it defaults to 10 minutes but can be set to any value.<br><br>A Seaside session can be forced-expired by sending #expire to the<br>session object.<br>This happens for instance when you select &quot;New Session&quot; in the toolbar.
<br><br>You may see situations where<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;WASession allGeneralInstances select: [ :each | each isActive ]<br><br>is empty, and<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;WASession allGeneralInstances reject: [ :each | each isActive ]<br><br>
is not empty. This means that all sessions have become unusable.<br>However they are still around in the image and this is designed that<br>way.<br><br>When Seaside sessions are created they are kept in a registry<br>(WARegistry)
<br>to ensure they are not garbage collected while being used.<br><br>&gt;From time to time(*), Seaside cleans up the contents of the registry and<br>unregisters those sessions that are found unusable.<br>See method WARegistry&gt;unregisterExpiredHandlers. The actual garbage
<br>collection of a Seaside session occurs some time (not immediately) after<br>it<br>has been unregistered, that is some more time after it has become<br>unusable.<br>An unusable session may sit for some time in the registry before it is
<br>unregistered.<br><br>(*) The clean-up of the session registry occurs every 10th (on average)<br>new session creation. See method WARegistry&gt;shouldCollectHandlers<br><br>See also<br><a href="http://lists.squeakfoundation.org/pipermail/seaside/2004-October/003704">
http://lists.squeakfoundation.org/pipermail/seaside/2004-October/003704</a>.<br>html<br><br>HTH<br>Michel.<br>_______________________________________________<br>Seaside mailing list<br><a href="mailto:Seaside@lists.squeakfoundation.org">
Seaside@lists.squeakfoundation.org</a><br><a href="http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside">http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside</a><br></blockquote></div><br><br clear="all">
<br>-- <br>*********************************************<br>Sylvain Pralon<br>Etudiant Genie Logiciel et Services<br>Ecole Supérieure d&#39;Ingénieurs d&#39;Annecy<br><br><a href="http://sylvain.pralon.free.fr">http://sylvain.pralon.free.fr
</a><br>*********************************************