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

Moving from 7.5.3 to 8.1.0: can't find the clearInvalid option equivalent #2391

Closed
briandela opened this issue Feb 4, 2015 · 6 comments
Closed
Assignees
Labels
support Questions, discussions, and general support

Comments

@briandela
Copy link
Contributor

Trying to update from hapi 7.5.3 to 8.1.0. In 7.5.3 we were able to specify default options on how to deal with cookies. For example, we could set the following options for state: { cookies: { clearInvalid: true } }.

I can't see how to do this in Hapi 8.1.0 - it looks like the only options under connections - routes - state are parse, and failAction. Any ideas how to globally set clearInvalid for cookies?

@AdriVanHoudt
Copy link
Contributor

@kanongil kanongil added the support Questions, discussions, and general support label Feb 5, 2015
@kanongil
Copy link
Contributor

kanongil commented Feb 5, 2015

Check the Server configuration and Connection configuration chapters in the migration guide.

@ubaltaci
Copy link

ubaltaci commented Feb 5, 2015

I also trying to find clearInvalid option in global manner

@AdriVanHoudt isnt it cookie based ?

@kanongil I've checked but could not find that in migration guide.

@AdriVanHoudt
Copy link
Contributor

@ubaltaci I don't know I have never used it. But it is the only clearInvalid I could find so you can give it a try.

@ubaltaci
Copy link

ubaltaci commented Feb 5, 2015

@AdriVanHoudt thank you,

@briandela I think i figure it out but I could not understand the logic of separation of these state options.

new Hapi.Server({connections: {
        state: {
            clearInvalid: true
        },
        routes: {
            state: {
                failAction: "log"
            },
        }
    }});

// or

server.connection({
   ... 
   state: {
        clearInvalid: true
    },
    routes: {
        state: {
            failAction: "log"
        }
    }
})

@hueniverse
Copy link
Contributor

@ubaltaci there are two sets of options:

  • settings for how to handle individual cookies in connection.state or when setting server.state()
  • settings for what to do with cookies in general when processing a route.

@hueniverse hueniverse self-assigned this Feb 7, 2015
@lock lock bot locked as resolved and limited conversation to collaborators Jan 11, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
support Questions, discussions, and general support
Projects
None yet
Development

No branches or pull requests

5 participants