You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by "Leonardo Uribe (JIRA)" <de...@myfaces.apache.org> on 2014/10/31 02:07:33 UTC

[jira] [Commented] (MYFACES-3936) Flash object requires cleanup strategy when client window feature is used

    [ https://issues.apache.org/jira/browse/MYFACES-3936?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14191145#comment-14191145 ] 

Leonardo Uribe commented on MYFACES-3936:
-----------------------------------------

Another change that we can do is remove the token if flash map is empty. Please note it is not possible to remove the token with the cookie hack used in 2.0.x / 2.1.x, because you cannot remove the cookie once the response has been committed, but you can manipulate the session object at the end of the request after the response has been generated (like it does with the state saving algorithm).

I tried to clear flash scope from the state saving algorithm, but it doesn't fit well, because flash scope is meant to be used on GET-GET or POST-REDIRECT-GET, so you don't really know when the client window has been discarded. 

> Flash object requires cleanup strategy when client window feature is used
> -------------------------------------------------------------------------
>
>                 Key: MYFACES-3936
>                 URL: https://issues.apache.org/jira/browse/MYFACES-3936
>             Project: MyFaces Core
>          Issue Type: Bug
>          Components: JSR-344
>    Affects Versions: 2.2.5
>            Reporter: Leonardo Uribe
>            Assignee: Leonardo Uribe
>
> In 2.2.x a change was done to Flash object, so now it uses the client window id and store the token into session instead use a cookie like it was done in 2.1.x/2.0.x
> The problem is there is no cleanup strategy in place. So if you create n client window ids, there are n tokens in session and the session will only be cleaned  up when the session is invalidated.
> The solution is use a LRU map to hold the tokens, so when a client window / token is discarded, the objects stored in Flash scope associated to that couple could be removed.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)