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

Persisting across redirects #25

Closed
trasher opened this issue Sep 17, 2016 · 2 comments
Closed

Persisting across redirects #25

trasher opened this issue Sep 17, 2016 · 2 comments

Comments

@trasher
Copy link

trasher commented Sep 17, 2016

Hello,

In some cases, I can have multiple redirections in my app; wich will cause my flash messages to be lost.
Back to Slim2, I got the same problem I was able to solve using the flashKeep() method.

Right now, I'm able to retrieve it by manually getting message, and settign them back again with addMessage; but that only works for one level redirection, I can have two :/

How should I resolve this? Is there a way to get kind of flashKeep() behaviour?

Thank you :)

@krotovic
Copy link

I think, it is possible, you can extend Slim\Flash\Messages::addMessage to add your persistent message to another $_SESSION key (e.g. $_SESSION["flash_persistent"]).
But if I were you I would rethink why I need multiple redirections in my app.

@trasher
Copy link
Author

trasher commented Jun 10, 2017

Hello,

You are right, I should not have multiple redirections; this is just the actual behavior and it will be quite difficult to fix (quite hard to find). But I do think this is the way to go :)

Thank you!

@trasher trasher closed this as completed Jun 10, 2017
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