New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Flash getting cleared if static assets served in between dynamic page requests. #109

Closed
sojin opened this Issue Sep 1, 2013 · 3 comments

Comments

Projects
None yet
2 participants
@sojin
Contributor

sojin commented Sep 1, 2013

Flash is supposed to be retained between subsequent request (at most one), but if any static asset is served in between, the Flash is getting cleared.

Almost all web apps would need to serve numerous static assets to get the page rendered and this defeat the purpose of Flashing.

FlashCookieImpl.save() is clearing all the Flash cookies if the outgoingFlashCookieData is empty. We could add a flag (something like 'keepFlash') in Context and set it to true from the AssetController and check this flag in FlashCookieImpl.save() before clearing.

Yes, ideally static assets should be served directly from a front end server (such as Nginx or Apache), but there are cases when we might not use them.

Cheers
Sojin

@ghost ghost assigned raphaelbauer Sep 1, 2013

@raphaelbauer

This comment has been minimized.

Contributor

raphaelbauer commented Sep 1, 2013

Hi Sojin,

good catch! You are absolutely right. Can you check if github.com//pull/110 (https://github.com/ninjaframework/ninja/branches/bugfix-109-static-assets-should-not-handle-flash-scope) fixes the issue for you? I also added testcases to make sure that this issue does not happen again.

Thanks!

Raphael

@sojin

This comment has been minimized.

Contributor

sojin commented Sep 2, 2013

Hi Raphael,

Thanks for the fix, its working for me. You may merge and close the issue.

Rgds
Sojin

@sojin sojin closed this Sep 2, 2013

@raphaelbauer

This comment has been minimized.

Contributor

raphaelbauer commented Sep 2, 2013

done

makotan pushed a commit to makotan/ninja that referenced this issue Feb 27, 2014

makotan pushed a commit to makotan/ninja that referenced this issue Feb 27, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment