Skip to Content
Phoenix Web Development
book

Phoenix Web Development

by Brandon Richey
April 2018
Beginner to intermediate content levelBeginner to intermediate
406 pages
9h 33m
English
Packt Publishing
Content preview from Phoenix Web Development

Sending a user ID through the controller

Now we need to devise a way to send the user ID of a logged-in user through the controller to the template and back again; this way, a user can be properly associated with every poll they create. To do this, we need to work with Phoenix's built-in session handling code. The good news is that getting data out of the session is just as easy as putting data into the session; essentially, the only difference is that we'll be calling get_session/2 instead of put_session/3.

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Phoenix in Action

Phoenix in Action

Geoffrey Lessel
Real-Time Phoenix

Real-Time Phoenix

Stephen Bussey

Publisher Resources

ISBN: 9781787284197Supplemental Content