Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

PHP PHP User Authentication Building the Library Building the Book List

Shoko Ishigaki
Shoko Ishigaki
21,826 Points

Why do we use Symfony HttpFoundation for redirects instead of header function?

Is there any reason for using Symfony HttpFoundation for redirects after adding books? I understand HttpFoundation has some useful features, but I feel like it is much simpler and easy to understand to use header function (i.e header('Location: ' . '/book.php'); ) for this case.

1 Answer

Shoko Ishigaki I think (not sure if it was on this course or another one) that the instructor @alenahilligan mentioned that there's not a right answer on regards to 'cookies VS session' when it comes to security and because of that she was going to be using some sort of mechanism from Symfony that makes the use of cookies very secure, so I'm guessing that the use of Symfony for redirecting might be related to that.