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 Browser Persistent Data with PHP Data Persistence on the Web Wrapping It All Up

Jonathan Grieve
MOD
Jonathan Grieve
Treehouse Moderator 91,253 Points

Debugging PHP Story app

Hello all,

I was able to follow and complete the course using localhost and it works perfectly at the moment.

But when I port it over to my website over at https://projects.jonniegrieve.co.uk/php_story/ there are a number of bugs that I can't get my head around.

  1. The website doesn't redirect to story.php after the 5th stage and instead the URL shows p=6 in the browser.

  2. No cookies are saved although PHPSESSID does show up in Chrome DevTools. so I can see that PHP is creating a session.

I wondered if it might be something to do with PHP versions but both my localhost and my web server use PHP7.

I just wanted to see if others had the same bugs?

1 Answer

I have a similar issue. Unfortunately configuring php production servers is not straightforward, and a lot of individual tweaking is usually necessary.

Running php_info() on your server will show you the current settings of php, make sure cookies and sessions are enabled.