You taught me a lot of brand new things in this video! This whole issue of Sessions and cookies was a lot in the dark for me, now you've put the sun on it, I love you Gio!!!
all things is quite perfect from the clear voice and accent to the amazing content , clear explanation , explanation of all deep topics .. and the best things is explain all things not just basic stuff
Ok so, I've used session start before. It was more like I copied it. It wasn't explained in the video I watched. I just knew the guy wrote it at the top of the script. No understanding at all. So I'm very grateful for this video and also grateful to know that you talk about it more in the 3rd section. Thanks Gio.
Thank you very much for the course its really helping alot, i have a question altho, in 7:28 inside Home.php what you return here is not the same as the one from the last episode, can clarify on that please?
Hi Gio, Some how, am not getting the increatment from $_Session['count']. Here are the codes: Home Class inside the index(), i added $_SESSION['count'] = ($_SERVER['count'] ?? 0 )+ 1 ; and on the index page var_dump($_SESSION); I am getting only one on the browser, Using Nginx with PHP 8.1.9. Thanks for your anticipated response. Also, the buffering has been set to 0 from my php.ini file.
Hi Gio - Love your course, I'm following every lesson. Thank you. My question: How would you manage that users session would stay active the whole day? Currently, the browser ends session after about 30 minutes or so of inactivity. My users log in and once logged in they refer to the app in different ways, but they don't sit there and look at the app, they multi-task and sometimes they are on a phone call - whatever it is, I must prevent the session from ending after non-activity - I only want the session to end at the end of the day.
Hello. Thank you for your support 💙. This mainly depends on how your code is set up, sessions configured, how it's persisted, etc. There are different ways you can implement this. You can have ajax call every few minutes or so to kind of ping activity & extend the session, you can play with session timeouts, can use cookies, etc.
When I change something in Dockerfile I run docker build behind the scenes and I mention in video that you should run it too. Otherwise if nothing has changed in Dockerfile or docker-compose then there is no need to rebuild
Hi Sir How are you, I need some help.I make a copy of the container php.ini on my host computer. If I change something in my host php.ini it doesn't change in container php.ini, how can I do that?
Awesome video !! .. but I have a question, I set the PHP session cookie to httponly (in server settings) and indeed the httponly mark showed up.. but why when I type document.cookie in the console I can still see the cookie value ? Thanks
Sorry, just saw this comment, I was not notified for some reason. Are you sure the cookie is httponly? If you can send me the screenshots of the way you set the cookie & the console.log of the document.cookie that would be helpful, you can send it to me on Twitter
There is one more video for section 2 scheduled to be released next week, then there will be a summary of what we did in the 2nd section (and a small exercise). After that, we'll begin 3rd section. Probably we'll start in a couple of weeks.
Gio, I've noticed that you run scripts in browser or via CLI and never directly via PHP Storm (Shift + F10). Is it just personal preferences or run scripts this way really worse than CLI? Thank you.
When we get to parts where there is something to share yes it's on GitHub & link in description. For some videos there isn't much to share since it's mostly theory & a scratchpad basically
I apologize, I should've mentioned this in the video & seems like I left it out by accident. Create a local.ini file in your docker directory if you are on docker, add whatever configs you want to change in that file, then in your docker-compose add this line within the app container section in volumes: - ./local.ini:/usr/local/etc/php/conf.d/local.ini rebuild the containers & you should be good. You can see example here: github.com/ggelashvili/expennies/tree/P2_Start/docker
Howdy Gio, I cannot do this lesson because of a fatal error. You say go to Home.php and have use App\View as well as $_SESSION['count'] = ($_SESSION['count'] ?? 0) +1; return View::make('index', $_GET)->render(); However, we do not yet view yet, what do we need to include in it.
Hello, you can comment that out, views are covered later and we implement that part. I had to re-record a small part of this video and recorded it with the code from a future lesson. You don't need views in this lesson so you can comment it out and just return string like in other methods.
Bro, in this video i see in the Home class it uses the view class. I have been following the course from the start and none of the previous videos talked about views. Please advise in which video was view covered before this one. Thank you.
Hello Gio. Is it ok to also say that "Once RESPONSE is sent to a page, you can no longer send any further headers" instead of "Once HEADERS are sent to a page, you can no longer send any further headers"?
Hi Gio, i dont get the fact we can't see the warning which is caused by having output_buffering > 0, start_session triggers E_WARNING, but if we do something like include('file_not_exists.php') it also trigger E_WARNING but this time we will see in a browser Warning: include(file_not_exists.php)...... So what's the difference between E_WARNING caused by start_session and include ?
start session doesn't always trigger warning when output buffering is > 0 because content isn't echoed on the screen until the end of the script or until it has buffered 4KB or whatever the output buffering is set to. Watch the part from 1:18 - 2:05 where I explain it.
@@ProgramWithGio yeaa, after some experiments with headers_sent() and curl -v to see fully response i finally understand that. thank you for your answer, and the whole course :)
Excellent as usual, just want to know how to copy the php.ini from wherever its source to the docker folder so I can edit things easily.. Google failed me on that so far Thanks again.
Thank you. I might make a separate video on that since a few others have asked the same. Basically, you can either copy your custom php.ini from Dockerfile or from docker-compose. Within your docker-compose, under volumes, you can create a section to copy your local php.ini to the proper location, something like: volumes: - ./php/local.ini:/usr/local/etc/php/conf.d/local.ini
Bro I asked this question 2 videos ago but did not get help. The question is this. I find that the info produced by $_SERVER differs terribly when I use xampp to run the script and when i use the PHP inbuilt server "php -S localhost:3000". I am using Windows 10 and PHP 8.1.12. This conflict becomes critical when i try to get REQUEST_URI parameter. When i use Xampp i get "/MyCoursesLG/php/courses/piocourse/src/public/" but when i use inbuilt server i get "/". This creates unnecessary coding variations especially when i tried to create basic routing. Why does this happen and how to resolve this?
I don't always get notified of all comments from TH-cam. When using something like XAMPP it runs using apache & apache has its own config which sets some of the options. php server may not set all of those things or may set them differently so there might be difference in what is available within $_SERVER variable. DM me on Twitter & send me your XAMPP apache vhost configuration to see if there is a misconfiguration.
@@ProgramWithGio Its ok. I realize that this is something that PHP developers need to fix immediately. I think it is important that they need to keep results consistent otherwise the value of the language will be lost. I am getting a similar problem with the time() function. The cookie is set using the UTC time although i have already specified the TimeZone as my local time in the ini file. The stupidity in this is that the expiry is checked against my local time but the cookie is created using UTC. Sigh!!
@@truthteachers I don't think there is an issue with it though, you should be able to configure most of the things including the timezones. For cookie you set expiration in unix timestamp essentially which is UTC. It shouldn't matter what time zone is on client.
You taught me a lot of brand new things in this video! This whole issue of Sessions and cookies was a lot in the dark for me, now you've put the sun on it, I love you Gio!!!
Super happy to hear that, glad it was helpful, thank you 💙💙💙
Never have seen this example of the php close tag problem. Great work Gio!
Thank you 💙
Very informative as always. Merry Christmas, hope your channel grows next year!
Thank you 💙. Merry Christmas & happy holidays 🎄⛄
all things is quite perfect from the clear voice and accent to the amazing content , clear explanation , explanation of all deep topics ..
and the best things is explain all things not just basic stuff
Thank you 🙌. Glad to hear you like the videos 💙
Thanks!
Thank you for your support 🙏
Ok so, I've used session start before. It was more like I copied it. It wasn't explained in the video I watched. I just knew the guy wrote it at the top of the script. No understanding at all. So I'm very grateful for this video and also grateful to know that you talk about it more in the 3rd section. Thanks Gio.
Glad to hear it was helpful, thank you
Perfect Perfect Perfect ..
Nobody says these details, thank you really alot.
#Respect
You're welcome & thank you 🙌
Thanks
Thanks for support 💙
A good course, I am waiting for a video on microservice architecture )
Thank you
Understood by watching it just one time as always😅Thanks GIO for helping us to go and get our dream job.
You got this 🤞👏
I enjoy learning PHP on this channel. Thanks!
Happy to hear that, thank you
Excellent work Sir... you pointed out each n every small small things, that no one talk about it...
Glad you like it, thank you
Thank you very much for the course its really helping alot, i have a question altho, in 7:28 inside Home.php what you return here is not the same as the one from the last episode, can clarify on that please?
I made some changes behind the scenes for this episode
Astounding as always 🏆
Thank you
I really learned a lot of things, THANK YOU!
Happy to hear 🙌
Hi Gio, Some how, am not getting the increatment from $_Session['count']. Here are the codes:
Home Class inside the index(), i added $_SESSION['count'] = ($_SERVER['count'] ?? 0 )+ 1 ; and on the index page var_dump($_SESSION); I am getting only one on the browser, Using Nginx with PHP 8.1.9. Thanks for your anticipated response. Also, the buffering has been set to 0 from my php.ini file.
Hello. You are using SERVER super global instead of SESSION in assignment. Change it to session and then it should work
@@ProgramWithGio Thanks. I just wasn't paying close attention. Thanks. Continuing.
Hi Gio - Love your course, I'm following every lesson. Thank you.
My question:
How would you manage that users session would stay active the whole day? Currently, the browser ends session after about 30 minutes or so of inactivity. My users log in and once logged in they refer to the app in different ways, but they don't sit there and look at the app, they multi-task and sometimes they are on a phone call - whatever it is, I must prevent the session from ending after non-activity - I only want the session to end at the end of the day.
Hello. Thank you for your support 💙. This mainly depends on how your code is set up, sessions configured, how it's persisted, etc. There are different ways you can implement this. You can have ajax call every few minutes or so to kind of ping activity & extend the session, you can play with session timeouts, can use cookies, etc.
awesome dear
Thank you
very good. thanks
Thank you
Good stuff, thank you !
Glad you liked it. Thank you
Thank you so much!
You're welcome 👍
Please tell me how does your app auto reflects code changes without the need to do a docker build
When I change something in Dockerfile I run docker build behind the scenes and I mention in video that you should run it too. Otherwise if nothing has changed in Dockerfile or docker-compose then there is no need to rebuild
@@ProgramWithGio thanks, at my project I change the php code but it's not reflected inside container
@@momahdy put your project in GitHub and DM me on Twitter and I can help troubleshoot it. Most likely some misconfiguration
great video
Hi Sir How are you, I need some help.I make a copy of the container php.ini on my host computer. If I change something in my host php.ini it doesn't change in container php.ini, how can I do that?
You need to add it to your docker-compose file under volumes
Thank you.
💙
Handy, thanks
👍👍
Awesome video !! ..
but I have a question, I set the PHP session cookie to httponly (in server settings) and indeed the httponly mark showed up..
but why when I type document.cookie in the console I can still see the cookie value ?
Thanks
Sorry, just saw this comment, I was not notified for some reason. Are you sure the cookie is httponly? If you can send me the screenshots of the way you set the cookie & the console.log of the document.cookie that would be helpful, you can send it to me on Twitter
@@ProgramWithGio thanks for the reply 🌹 ..
Yes plz I'd be grateful if you share your Twitter ID here 🙏
@@mibrahim4245 its on my TH-cam channel about page. @Giodev8
When is the third sections going to be released?
There is one more video for section 2 scheduled to be released next week, then there will be a summary of what we did in the 2nd section (and a small exercise). After that, we'll begin 3rd section. Probably we'll start in a couple of weeks.
Gio, I've noticed that you run scripts in browser or via CLI and never directly via PHP Storm (Shift + F10). Is it just personal preferences or run scripts this way really worse than CLI? Thank you.
Not everyone has IDE and may not understand what's happening. Showing results in browser or running it in CLI makes following along a bit easier.
Do we have these code shared some where on github?
When we get to parts where there is something to share yes it's on GitHub & link in description. For some videos there isn't much to share since it's mostly theory & a scratchpad basically
Thanks for everything you do Gio, but please I would like to know how you are able to edit your php.ini file
I apologize, I should've mentioned this in the video & seems like I left it out by accident. Create a local.ini file in your docker directory if you are on docker, add whatever configs you want to change in that file, then in your docker-compose add this line within the app container section in volumes:
- ./local.ini:/usr/local/etc/php/conf.d/local.ini
rebuild the containers & you should be good. You can see example here: github.com/ggelashvili/expennies/tree/P2_Start/docker
@@ProgramWithGio thanks, you are doing a great job😀
@@mimlog6593 no problem 👍
Howdy Gio,
I cannot do this lesson because of a fatal error.
You say go to Home.php
and have
use App\View
as well as
$_SESSION['count'] = ($_SESSION['count'] ?? 0) +1;
return View::make('index', $_GET)->render();
However, we do not yet view yet, what do we need to include in it.
Hello, you can comment that out, views are covered later and we implement that part. I had to re-record a small part of this video and recorded it with the code from a future lesson. You don't need views in this lesson so you can comment it out and just return string like in other methods.
Bro, in this video i see in the Home class it uses the view class. I have been following the course from the start and none of the previous videos talked about views. Please advise in which video was view covered before this one. Thank you.
That one slipped into this video, you dont need to worry about it, we cover it within the MVC video which is 2.27, so you will get to it in 2 videos
@@ProgramWithGio Great thank you. Appreciated.
Hello Gio. Is it ok to also say that "Once RESPONSE is sent to a page, you can no longer send any further headers" instead of "Once HEADERS are sent to a page, you can no longer send any further headers"?
yea cause response would also be sending headers
Hi Gio, i dont get the fact we can't see the warning which is caused by having output_buffering > 0, start_session triggers E_WARNING, but if we do something like include('file_not_exists.php') it also trigger E_WARNING but this time we will see in a browser Warning: include(file_not_exists.php)...... So what's the difference between E_WARNING caused by start_session and include ?
start session doesn't always trigger warning when output buffering is > 0 because content isn't echoed on the screen until the end of the script or until it has buffered 4KB or whatever the output buffering is set to. Watch the part from 1:18 - 2:05 where I explain it.
@@ProgramWithGio yeaa, after some experiments with headers_sent() and curl -v to see fully response i finally understand that. thank you for your answer, and the whole course :)
Excellent as usual, just want to know how to copy the php.ini from wherever its source to the docker folder so I can edit things easily.. Google failed me on that so far Thanks again.
Thank you. I might make a separate video on that since a few others have asked the same. Basically, you can either copy your custom php.ini from Dockerfile or from docker-compose. Within your docker-compose, under volumes, you can create a section to copy your local php.ini to the proper location, something like:
volumes:
- ./php/local.ini:/usr/local/etc/php/conf.d/local.ini
did I miss a video where you setup the php ini?
No don't think you did. Check my reply to Mim Log's comment here
@@ProgramWithGio thanks so much Gio
@@stephen.cabreros no problem 🙌
Can you create a video about JWT?
Maybe in future, I'll add it to the list. Thank you for the suggestion.
🎉
💙
👍🙏
🙏
Bro I asked this question 2 videos ago but did not get help. The question is this. I find that the info produced by $_SERVER differs terribly when I use xampp to run the script and when i use the PHP inbuilt server "php -S localhost:3000". I am using Windows 10 and PHP 8.1.12. This conflict becomes critical when i try to get REQUEST_URI parameter. When i use Xampp i get "/MyCoursesLG/php/courses/piocourse/src/public/" but when i use inbuilt server i get "/". This creates unnecessary coding variations especially when i tried to create basic routing. Why does this happen and how to resolve this?
I don't always get notified of all comments from TH-cam. When using something like XAMPP it runs using apache & apache has its own config which sets some of the options. php server may not set all of those things or may set them differently so there might be difference in what is available within $_SERVER variable. DM me on Twitter & send me your XAMPP apache vhost configuration to see if there is a misconfiguration.
@@ProgramWithGio Its ok. I realize that this is something that PHP developers need to fix immediately. I think it is important that they need to keep results consistent otherwise the value of the language will be lost. I am getting a similar problem with the time() function. The cookie is set using the UTC time although i have already specified the TimeZone as my local time in the ini file. The stupidity in this is that the expiry is checked against my local time but the cookie is created using UTC. Sigh!!
@@truthteachers I don't think there is an issue with it though, you should be able to configure most of the things including the timezones. For cookie you set expiration in unix timestamp essentially which is UTC. It shouldn't matter what time zone is on client.
thank you!
You're welcome!