Тёмный

25 | How to Create Sessions in PHP for Beginners | 2023 | Learn PHP Full Course For Beginners 

Dani Krossing
Подписаться 482 тыс.
Просмотров 42 тыс.
50% 1

Опубликовано:

 

23 сен 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 41   
@akashgola2153
@akashgola2153 6 месяцев назад
Watching for the first time "oh i see i see" , watching it the 2nd time "oh so that's what it was for now i get it", Thanks for this precious series Dani.
@joeyzazzi6913
@joeyzazzi6913 5 месяцев назад
One of the best descriptions of cookies and sessions. Thank you for helping me understand!
@akamgodlovetabit
@akamgodlovetabit 9 месяцев назад
I've been following your tutorial and I just love the way you explain how the code works. We all appreciate your work
@Xoloes
@Xoloes 24 дня назад
underrated🔥
@interestingfactsandinnovat6846
@interestingfactsandinnovat6846 5 месяцев назад
I don't know why I enjoy the lecture too much each time.❤ Sir
@vanpersie8770
@vanpersie8770 Год назад
Am a huge fan. You make learning programming simple to understand and fun. Thank you
@CsMuia
@CsMuia Год назад
I have been looking forward to this tutorial, always a pleasure learning from you Dani. Everyday it's a new day to learn something new. Keep up the good work, you are a blessing to many others.
@thepureheartofdark
@thepureheartofdark 10 месяцев назад
Thanks for the quick tutorial. I now know what I was missing.
@neilakrika9964
@neilakrika9964 5 месяцев назад
thank you, you explain well
@mcmehdi8782
@mcmehdi8782 4 месяца назад
ty
@aisomusic
@aisomusic Год назад
I like to add session_write_close as soon as possible after session start to prevent pages from locking up other pages while the page is executing.
@johngoldietech7259
@johngoldietech7259 6 месяцев назад
Thanks for the amazing videos.
@AxxionMarketPlace-iu6ri
@AxxionMarketPlace-iu6ri Год назад
Thank you
@victorr6550
@victorr6550 Год назад
Thank u. This helps a lot.
@jessyelisius3016
@jessyelisius3016 Год назад
I've been looking for forward to this, thanks Dani. it will be nice if you could help out with namespaces.
@vanpersie8770
@vanpersie8770 Год назад
Love you hairstyle.
@fuzzy-02
@fuzzy-02 8 месяцев назад
What a great video, thank you! My doctor didn't explain stuff this clearly and I was confused on undet and destroy. Will putting destroy in a form that goes to the same page be considered going to "another" page? I will test that out.
@Izkawi33
@Izkawi33 Год назад
Here are what I got from this lesson - Sessions are stored in the server side - to start a session you write sesssion_start() function before any session variable - unset() function is used to unset any type or variables even normal variables not only session variables example unset($var1 ,$var2, $var3) - session_unset() function unset all session variables - session_destroy ends and completey remove the session from my page but this must be executed in every page but better to use session_unset() remove all sesssion data am I right Mr Dani?
@Dani_Krossing
@Dani_Krossing Год назад
session_destroy should be used whenever you are done with the session. 🙂 So not on every page. For example if a user is logged in, then we want the session running until they log out, so when they log out THEN we destroy the session. 🙂 And yes a session is a link between the user and the server, so a session ID will be stored in both the client (as a cookie), and on the server.
@Izkawi33
@Izkawi33 Год назад
@@Dani_Krossing so I use session_unset Then Session_destroy
@Dani_Krossing
@Dani_Krossing Год назад
Whenever you don't need the session anymore, then you session_unset and session_destroy yes.
@astonmargolis4391
@astonmargolis4391 10 месяцев назад
Hey there king! dope tutorial, however Im hitting a stumbling block where even though my two pieces of code are identical (copy and pasted) index runs but example does not and it gives me an undefined array warning. No idea why.
@dejanvelkovski-cq7pu
@dejanvelkovski-cq7pu 3 месяца назад
I put the sentence $_SESSION["username"] = "Krossing"; in example.php and at the beginning i opened index.php said error then try to open example said Krossing after it refresh the site index.php Krossing appeared why was the error for
@ingelegenial
@ingelegenial 7 месяцев назад
Hey Danni. This is super useful. Just a quick question, when I try to inspect my page, I can only see "PHPSESSID" cookie and not pma_lang. Am I doing something wrong?
@vanpersie8770
@vanpersie8770 Год назад
Please can you create android and iOS tutorials for us beginners and also mode js. Thank you
@lordsupasta
@lordsupasta 5 месяцев назад
I'm sure you've gotten this before but you're nearly a spitting image of Elon
@HumairaMALIK-d7o
@HumairaMALIK-d7o Год назад
Many many Thanks Dany for your course. Session super global didn't work for me. My example.php page is showing error of undefined variable.
@Dani_Krossing
@Dani_Krossing Год назад
99% of the time, it's because of a typo. 🙂 Even when people say they "copied everything exactly". But you are more than welcome to share the code here, so I can help you find it.
@takloodonff
@takloodonff 4 дня назад
What is in css folder....why u always make css folder....
@Chief_Sir_E.C.O._Nwuju
@Chief_Sir_E.C.O._Nwuju 10 месяцев назад
How do I do this in a react application
@gauravkaushik211
@gauravkaushik211 8 месяцев назад
What happens when let's say I have a login system and I copy the session cookie and paste it on another system. Would that log into the site ? If yes then how do I protect my site from that?
@Dani_Krossing
@Dani_Krossing 8 месяцев назад
Session hijacking is something that you also need to protect yourself against, to make sure that other people doesn’t get access to your session through your cookie. You can do things like making sure the cookie gets regenerated periodically, and I do actually have a “security video”, which goes over basic examples. 🙂 if I remember correctly, it is in this playlist as well. But I just wanna point out, that while it is good to understand security, you will have much of this taken cared of when you use frameworks like Laravel. So it’s generally recommended not to ”create security code from scratch”, since others have done it better for you.
@abu-bakrmohamed1707
@abu-bakrmohamed1707 9 месяцев назад
I've reached the end of this course, this was so fun ! 🤍🤍🤍
@kenhaley4
@kenhaley4 11 месяцев назад
I didn't quite understand the point of session_destroy. If every page on the website has a session_start() command at the top, woouldn't that undo the destroy? It seems like session_unset would actually do everyhing we want, so why use session_destroy()?
@Dani_Krossing
@Dani_Krossing 11 месяцев назад
Let's take an example to better visualize it. 🙂 Imagine you have a safe which has a code to enter it, and inside the safe there is money. When you are done with your safe, you have two options... 1. You can remove the cash from the safe. 2. You can throw out the safe, and get a new one. So let's take an example, where a thief has figured out the combination to your safe... If you just go with option 1 (unset), then there is no money for him to steal, but he will STILL know how to get into the safe. Which means the next time we put money in there, he can grab it. If you go with option 2 (destroy), then the thief no longer has access to your safe, since you got yourself a new safe. And this is how session_unset() and session_destroy() work. 🙂 One removes the data, and the other destroys it, which forces a new session to be created. So essentially what we do by combining the two, is that we "remove the money, and then get a new safe", to be completely sure that the thief (hacker) doesn't have access.
@kenhaley4
@kenhaley4 11 месяцев назад
@@Dani_Krossing Thanks for that great explanation! So it makes sense to both unset and destroy. Next question: Suppose the session times out due to no activity... is the session destroyed in that case? I would hope so, as I wouldn't have the chance to destroy it explicitly in code. Or am I asking a question you'll be answering in a subsequent video? Thanks again for the quick reply!
@Wai78_
@Wai78_ 11 месяцев назад
@@Dani_Krossing wow the example is great. Now I get it.
@user-kp8dt4ei4l
@user-kp8dt4ei4l Год назад
Is it just me that hears "lock in system" lol?
@StorytimeDreamland
@StorytimeDreamland Год назад
sorry it is not good practice, can you make a better session tutorial with native php by creating a session class, and starting session @ some common page instead of adding it to all pages ?
@Dani_Krossing
@Dani_Krossing Год назад
Keep watching ... 😉 As I explained in this video, this one only introduces people to what a session is. In the "session security" video coming up, I show how to create a config file for sessions.
Далее
Artist 4-Mavsum 20-son FINAL  (21.09.2024)
2:20:46
Просмотров 325 тыс.
4 YEAR SIBLING DIFFERENCE! 😭 #shorts
00:11
Просмотров 12 млн
Ozoda - Lada (Official Music Video)
06:07
Просмотров 6 млн
Coding Was HARD Until I Learned These 5 Things...
8:34
Difference between cookies, session and tokens
11:53
Просмотров 631 тыс.
PHP For Beginners, Ep 37 - Sessions 101
13:57
Просмотров 13 тыс.
Vim Tips I Wish I Knew Earlier
23:00
Просмотров 66 тыс.
Are we going back to PHP with fullstack JavaScript?
9:57
13 Things To Remove From Your Website Immediately
12:33
Artist 4-Mavsum 20-son FINAL  (21.09.2024)
2:20:46
Просмотров 325 тыс.