0

In Symfony2, how to access session object and check whether Session is set or not from a twig file?

1 Answer 1

2

It's a pretty easy stuff.

You can access the session with this shortcut:

{{ app.session.get('key') }}

Also check for existence:

{{ app.session.has('key') }}
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.