Skip to content
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

Cannot use 'grails.plugin.cookiesession.serializer' #74

Open
fchristol opened this issue Nov 29, 2017 · 1 comment
Open

Cannot use 'grails.plugin.cookiesession.serializer' #74

fchristol opened this issue Nov 29, 2017 · 1 comment

Comments

@fchristol
Copy link

fchristol commented Nov 29, 2017

Hello,

I have created a custom Session serializer which implements SessionSerializer and that is declared as bean mySessionSerializer.
But I cannot use it with : grails.plugin.cookiesession.serializer='mySessionSerializer'

The reason is that it seems that there is a bug in CookieSessionRepository.groovy, in line :

else if( applicationContext.containsBean(serializer) && applicationContext.getType(serializer) instanceof SessionSerializer ){

Indeed, the test "applicationContext.getType(serializer) instanceof SessionSerializer" is never 'true'.
It is even not 'true' for the 'javaSessionSerializer' :

"applicationContext.getType('javaSessionSerializer') instanceof SessionSerializer" is 'false'

My two cents is that the test should be :

"applicationContext.getBean(serializer) instanceof SessionSerializer", which returns 'true' as expected

@double16
Copy link

double16 commented Jan 9, 2018

If you are using Grails 3, please try http://plugins.grails.org/plugin/double16/cookie-session . This issue has been addressed there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants