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

Session storage validation #53

Closed
ghost opened this issue Apr 18, 2016 · 4 comments
Closed

Session storage validation #53

ghost opened this issue Apr 18, 2016 · 4 comments

Comments

@ghost
Copy link

ghost commented Apr 18, 2016

I am trying to implement @akrabat's Session Middleware and Slim-Csrf middleware together, but the validation in the __construct is blocking me (or I don't see the correct way).

I am registering both middlewares as follows:

$app->add(new \RKA\SessionMiddleware(['name' => 'session']));
$app->add(new \Slim\Csrf\Guard);

but I always get CSRF middleware failed. Session not found. Changing the order of the registration of these middlewares is not helping either. I think the reason is that the validation for existing session is done at initialization of the Guard class and this is not giving change of the previous middleware to start the session because it's not yet invoked.

@akrabat
Copy link
Member

akrabat commented Apr 18, 2016

I bet that most of the constructor to Guard could be done at __invoke time.

@ivandokov
Copy link
Contributor

@akrabat can you please take a look at this PR #55

@aurmil
Copy link

aurmil commented Dec 6, 2016

hi
any news on how to make these 2 middlewares work together?

@ivandokov
Copy link
Contributor

The PR is waiting for review. Hopefully @akrabat will have time to check it soon.

akrabat added a commit to akrabat/Slim-Csrf that referenced this issue Dec 6, 2016
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

3 participants