Dirk
Dirk

Reputation: 3401

Access Session in Leaf template

I have a question regarding the Leaf template engine.

How can I access the Session values in the Leaf Template? For instance to loop through Flash messages like in Laravel: https://laravel.com/docs/5.3/redirects#redirecting-with-flashed-session-data

I can't find a solution to accomplish this.

Thanks in advance

Upvotes: 1

Views: 258

Answers (1)

Gianluca Tranchedone
Gianluca Tranchedone

Reputation: 3598

The latest version of Vapor includes the request by default when rendering views. Therefore you'll be able to access the session using

#(request.session) // in the latest version of Vapor

Upvotes: 2

Related Questions