Тёмный

Laravel 8 tutorial - Session | with login example 

Code Step By Step
Подписаться 316 тыс.
Просмотров 106 тыс.
50% 1

In this laravel 8 and 9 video tutorial, we learn what is session and why we use it in simple example. This video is made by anil Sidhu in the English language
request method names
steps of video
Laravel Session
Make Login Form
Get data from Session
Delete data from Session
Laravel 9 tutorial
Laravel 9 tutorial playlist : • Laravel 9 tutorial

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

 

22 сен 2024

Поделиться:

Ссылка:

Скачать:

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

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 124   
@codestepbystep
@codestepbystep 2 года назад
Please support me by subscribe, like and comment :) thank you
@The_Suraj_Khot
@The_Suraj_Khot Месяц назад
In this video i think i just learned advance web development 😅🔥 Now i can develop website
@dharmishthapatel3064
@dharmishthapatel3064 3 года назад
Interview Question - answer : Session data must be store from server side. However, Cookie data store from Brower side.
@exaaltare1170
@exaaltare1170 3 года назад
Perfect video, i would just add Route::get('profile',function(){ if(!session()->has('user') ){ return redirect('login'); }else{ return view('profile'); } }); So you could not access your profile page __until__ you started session( logged in ).
@ihtishamkhan5914
@ihtishamkhan5914 2 года назад
thanks bro now it is completed
@kaungmyatpaing13
@kaungmyatpaing13 2 года назад
the video is somehow informative. But I just need this code. It works for my problem xD.
@freerelax8964
@freerelax8964 4 года назад
Interview question : Session store in sever side.
@NSC_706
@NSC_706 2 года назад
Excellent explain in too easy way👍🎉
@gopalkathiriya6718
@gopalkathiriya6718 2 года назад
The session data that you read and write using $_SESSION is stored on server side, usually in text files in a temporary directory
@nuraenaramdani9558
@nuraenaramdani9558 2 года назад
Thankyou bro you saved my life!!!! keep up the great video :)))
@dfordemo981
@dfordemo981 2 года назад
we can do simple "php artisan ui:auth" to make login/register form, very quick with single command
@sitararafaqat
@sitararafaqat Год назад
its incredible video
@Ramziddin_Rustamovv
@Ramziddin_Rustamovv 2 года назад
Great 😊😊😊😊😊😊👌👌👌👌
@rykov1073
@rykov1073 2 года назад
Thanks your explanation is easily understandable
@dianaeftaiha
@dianaeftaiha 3 года назад
Great stuff Anil. Thanks
@mcmehdi8782
@mcmehdi8782 Год назад
great explaining ty so much love
@basharomari163
@basharomari163 Год назад
THANK YOU THAT WAS REALLY HELPFUL !!!♥️♥️♥️🔥🔥👍👍
@sagarlandge3271
@sagarlandge3271 3 года назад
exactly what I needed
@rohitgour2896
@rohitgour2896 10 месяцев назад
I have a question in session i see you stored data in session and using this data in view here where you stored data on server and how we can say its stored on server? And i can do this same with the cookies, means setup data inside cookies and get on view.
@MonirulIslam-sg7oh
@MonirulIslam-sg7oh 3 года назад
Great series ever I have seen
@noorfaithful
@noorfaithful 2 года назад
plz make video in good style login page with like js when we put wrong password then show error and when we sput small password and popup show enter atleast 8 character i can understand onlly your videos and other youtubers i have alot of confussion
@noor-ul-sabahafeez5543
@noor-ul-sabahafeez5543 3 года назад
hello sir! can you tell me how to store session variable in database and move it multiple pages?
@dfordemo981
@dfordemo981 2 года назад
simply get value from the form which is submitted, all the data will be in $request, so put these values from $request to sessions, and you can use these values across the multiple pages. 😊😊
@tofik7307
@tofik7307 4 года назад
hello sir, can you please make a video on middleware and theme integration in Laravel 8, and thanks for your efforts.
@guilhermebrante7457
@guilhermebrante7457 3 года назад
muito obrigado!
@janelmerlanceigot8557
@janelmerlanceigot8557 Год назад
Hi I have a question, will the session automatically removed or logout user if the browser is closed?
@AstraByteEducation
@AstraByteEducation 3 года назад
Perfect video Thanks brother
@mejiger
@mejiger 2 года назад
excellent tutorial but once you have logged in the link should have been 'logout' which would redirect you to login page
@Shiv-vb1re
@Shiv-vb1re 3 года назад
Thanks
@ashokbishwas
@ashokbishwas Год назад
Interview question answer. Cookies and Sessions are used to store information. Cookies are only stored on the client-side machine, while sessions get stored on the client as well as the server. mainly on the server side. Session can have more data.
@alieonline5984
@alieonline5984 3 года назад
Its saved on server side. But I want to make a view which should not open without having specific data in the server. Like: session()->put('user',$data['type']); If the session user has seller data it should open but if the user session has the any other data it should not open.
@madhuraj1194
@madhuraj1194 Год назад
Sir, please do react tutorial in english
@namanyasiapa7397
@namanyasiapa7397 3 года назад
very helpful, thank you :)
@akashaanwar6884
@akashaanwar6884 2 года назад
Thanks For This . :)
@TherealEmemay
@TherealEmemay 2 года назад
Thank youuuuuu
@joaoxavier8081
@joaoxavier8081 3 года назад
thanks for this video
@jayprajput1998
@jayprajput1998 3 года назад
We will use to middleware for authentication. And connecting database
@DesignToDeploy
@DesignToDeploy 2 года назад
Answer: Session data store in server Please make a class for login system using database. Thank you so much for your support.
@sayedalimousavi6091
@sayedalimousavi6091 2 года назад
Hi, Sir. Please make a video on Cookie Session Driver in Laravel 8.
@smitkumarshah6947
@smitkumarshah6947 2 года назад
I have a question i am making a page where login is in header so it passes through some pages of my website And on some pages you must have to be logged in to access Now the problem is on some pages i go with some get method variables and ehn i log in on that page i must land on the same page with same values in the get variables. How do i do that? I have one thought that is i store that values in session rather then get method.
@wasimjaved2956
@wasimjaved2956 2 года назад
i am getting error on clicking logout that requested url not found.
@kaziovesh9798
@kaziovesh9798 4 года назад
Sir session server side or browser side dono jagah store hota he.. Browser side session is commonly use in smallest applications... And servers side session is use in largest application.. Am i right sir? Ya kuch adhura kaha?😬
@ariyansgroup
@ariyansgroup 2 года назад
Sir, redirect('profile') is not working, so I given return view('profile'); then only its forwarding to profile page... y?
@maunfahima1636
@maunfahima1636 2 года назад
it will be logout link after login
@karthicgajendran4721
@karthicgajendran4721 3 года назад
Pls suggest. How to check session in middleware.
@kanchannawkar5739
@kanchannawkar5739 3 года назад
Hello sir, I am exactly copied your code but still i am getting error object not found for logout route
@prashantsingh-ps6ly
@prashantsingh-ps6ly Год назад
🥲
@AkashKumar-dc5cr
@AkashKumar-dc5cr 2 года назад
How can user login using database credentials
@miawmiaw3727
@miawmiaw3727 3 года назад
thank youuuu
@osamawaseem7006
@osamawaseem7006 3 года назад
Bro plz tell i want to done that if session is not set a user cannot access the view so we done this simply by using simple php but here you have done this thing in web.php but i want to do this in view how is it possible plz tell me
@programmerakash4572
@programmerakash4572 3 года назад
Sir Laravel 8 me web.php se admin ko login Krna h aur customer ko api.php se login Krna h to kese ho ga pls btaeye....
@subratajana1031
@subratajana1031 2 года назад
Session will always be stored on server side and cookies will be stored on client side
@laibatanveer6091
@laibatanveer6091 3 года назад
why you use user as a route ?from where it comes is this model?
@amolasodekar93
@amolasodekar93 3 года назад
how to get the session data in other controller? like in construct method or other method
@dfordemo981
@dfordemo981 2 года назад
anything you get from the request, store the you wanted values to the sessions, and use them anywhere
@AjayKumar-sn5yk
@AjayKumar-sn5yk 3 года назад
we are able to go on profile page directly without login if we change url,how we can prevent
@sargisgrigoryan254
@sargisgrigoryan254 3 года назад
Why don't you make a tutorial about cookies, which is an important topic
@codestepbystep
@codestepbystep 3 года назад
Okay, i will make
@amir-dev
@amir-dev 3 года назад
It's good to store sessions in the server side and in the table for sessions!
@rohitdurgapal4692
@rohitdurgapal4692 2 года назад
How to restrict user go to profile page if it's not login.
@tellavenky5079
@tellavenky5079 3 года назад
hi sir in profile.blade.php file for session storage your using three {{ }}} y sir?
@yasirjani4u
@yasirjani4u 3 года назад
bravo
@tiktoktrends7691
@tiktoktrends7691 2 года назад
It stores it on the server side
@marvinmachitar7229
@marvinmachitar7229 3 года назад
8:35 should be logout right?
@guilhermemoraes4055
@guilhermemoraes4055 3 года назад
Yeah, that was a misspell. And also it's a button display, you can put anything you want.
@yahampathkahakanda874
@yahampathkahakanda874 3 года назад
Dear.... how to store a session in variable laravel 8...
@beatrizsilva1536
@beatrizsilva1536 3 года назад
Hi! can you help me? I need to create a session CRUD. I have to pass data from one form to another, and include this second form in the database ... Is it possible?
@glauberbispocruzcarvalho2235
@glauberbispocruzcarvalho2235 3 года назад
yes
@apuemdad2125
@apuemdad2125 Год назад
The only problem of your tutorial is you don't put git repo in descripiton.
@davidcopperfield2278
@davidcopperfield2278 3 года назад
after I try to submit, i get a: The POST method is not supported for this route. Supported methods: GET, HEAD. any suggestions ?
@manishdevindia
@manishdevindia 3 года назад
Please check route... use post instead of get...
@kishanggajera50
@kishanggajera50 2 года назад
data store in server side
@jdd4622
@jdd4622 3 года назад
hello, I'm having a problem I used post on the form and also on the route but it's not working, what should I do?
@dfordemo981
@dfordemo981 2 года назад
may be @csrf token is missing
@akashmalik2776
@akashmalik2776 3 года назад
how to add two or more value in session?
@dfordemo981
@dfordemo981 2 года назад
just use session()->put($key, $value) or Session::put($key, $value); it will host all of the values, and you can set its expiry time on config/sessions.php config file, by default it is 120 minutes
@noor-ul-sabahafeez5543
@noor-ul-sabahafeez5543 3 года назад
i need to know tell me
@abdullahahmed8369
@abdullahahmed8369 3 года назад
But I can visit profile page without creating a session
@zaki8551
@zaki8551 4 года назад
Hello sir i wanna ask do you connect it to database?
@dfordemo981
@dfordemo981 2 года назад
suppose you are working on xampp create database in laravel's .env file, set the database credentials like database_name, database_user, password, host etc re-run "php artisan serve", your connection will be established successfully
@zaki8551
@zaki8551 2 года назад
@@dfordemo981 thanks for the answer but I already forgot about my project lol
@dfordemo981
@dfordemo981 2 года назад
@@zaki8551 hehe, okay, now it'll be the answer for rest of the commenters 🙂👍
@leonardoespina5890
@leonardoespina5890 4 года назад
FINE ASI ES QUE SE HACE
@petarpetrovic8744
@petarpetrovic8744 Год назад
Browser side
@fahadmaqsood5636
@fahadmaqsood5636 3 года назад
session data is stored on server side
@akashmalik2776
@akashmalik2776 3 года назад
Session stored data on server side
@kaziovesh9798
@kaziovesh9798 4 года назад
Sir u say link is given description box...but we didn't find any link in description box....
@codestepbystep
@codestepbystep 4 года назад
For what?
@codestepbystep
@codestepbystep 4 года назад
Code?
@kaziovesh9798
@kaziovesh9798 4 года назад
@@codestepbystep 1:39 u say link is given in description box.... what is post what is get what is put.....vhi link ki bat kr rha hu.... And thank s for alll laravel 8 video...bahut kuch apse sikhne ko mila or aage apse sikhte rhenge :)
@codestepbystep
@codestepbystep 4 года назад
Okay, m description box me bta describe krta hu bro
@someshpaul6599
@someshpaul6599 3 года назад
how can we only store data only when user click remember me kindly anyone respond
@abdulwadoodkhan826
@abdulwadoodkhan826 3 года назад
redirect function does not work!!!
@shujatali4101
@shujatali4101 3 года назад
Hello all please help me I m using session for login its work on localhost but when i upload on live server its give me 419 page expired
@GauravSharma-rl1df
@GauravSharma-rl1df Месяц назад
you forgot to add @csrf in your form
@jeredE99
@jeredE99 3 года назад
what about registration?
@rin7738
@rin7738 3 года назад
I am experiencing an error “The POST method is not supported for this route. Supported methods: GET, HEAD.” I followed your video.
@codestepbystep
@codestepbystep 3 года назад
This is very common error, check out your router method name please
@rin7738
@rin7738 3 года назад
@@codestepbystep oh yeah about that i checked it. I was using post method on Ajax and the route is also route::post(). I wonder what is the problem.
@codestepbystep
@codestepbystep 3 года назад
@@rin7738 so you find solution ?
@rin7738
@rin7738 3 года назад
@@codestepbystep No, not yet. I will check it out again tomorrow maybe. Need to rest first. :)
@flowertube1047
@flowertube1047 3 года назад
@@rin7738 i have same error, did u find a solution ?
@saulgvili5387
@saulgvili5387 3 года назад
Anil, at the last modification, you changed the "return redirect('login');" to "return view('login');". Can you please explain? I made the same change to the return of the 'profile' and it worked as well. Not sure what is going on there.
@50dipta
@50dipta 3 года назад
One can redirect to a page if that is defined from the route. As per the video, the previous login route was commented out. So now if someone want to redirect ('login'); then it will show error. By using return view('login'); , the login route is defined. So first you have to define the route, then you can call the route by return redirect. Please correct me if I am wrong.
@freshNolly1234
@freshNolly1234 Год назад
You have an if..else statement, right?....now this is the thing,most sites are properly build not just for user to consume but to reduce access a hacker can get into it... In a situation where by a hacker tries to bypass your profile and get into your login page using /login, it will redirect him back to the profile, it will only get to the login form if he/she clicks on the logout button. So just follow up the video again, you will get it
@Ramziddin_Rustamovv
@Ramziddin_Rustamovv 2 года назад
Serverside
@mkguru4910
@mkguru4910 4 года назад
i am facing undefine error when i try to echo session ('user') The error is Undefined index: user
@JasvirSingh-fd6fp
@JasvirSingh-fd6fp 4 года назад
check in your form
@amitsinghchhonker2055
@amitsinghchhonker2055 3 года назад
same here bro ....why the undefined index is comming even when we have coded same thing plz help ?
@NvmThemHereIAm
@NvmThemHereIAm 3 года назад
@@JasvirSingh-fd6fp had the same problem, this fixed it. Thank you!
@sheltoncastelino8889
@sheltoncastelino8889 3 года назад
In session('your-own-key') we put key name we assigned in put function Like $req->session()->put('your-own-key',$data['name-specified-in-form-field']); In profile page {{session('your-own-key')}}
@DanangAjiOne
@DanangAjiOne 3 года назад
@@sheltoncastelino8889 can we store more than one data in session like two key and the data in put method?
@guilhermemoraes4055
@guilhermemoraes4055 3 года назад
Well that's not login once you are not checking the database...
@codestepbystep
@codestepbystep 3 года назад
Yes, this is a session example
@akshaypawar7967
@akshaypawar7967 3 года назад
Session store in browser
@amirafrootan2030
@amirafrootan2030 3 года назад
no. session store in server
@eduardoalencar376
@eduardoalencar376 3 года назад
Poxa, que perda de tempo foi assistir isso... Sem conexão com o banco de dados meio que não adianta de nada.
@sunnyjovita8274
@sunnyjovita8274 3 года назад
Hello sir, i want to ask, do you know how to do this after we do POST login in frontend laravel? I made 2 different laravel projects, the first project is for laravel backend, and the other one is for laravel frontend. However, initially, before i separated the projects, session worked properly. But now, after i split the projects, i can't show the hello, 'username' since it seemed there were something wrong in the session. May i contact u personally? Thank you in advance.
@grendo9928
@grendo9928 2 года назад
thanks
@Defaulttt
@Defaulttt 3 года назад
Okay, so how do I prevent logout by pressing the back button from the browser?
@solidcat3917
@solidcat3917 3 года назад
you need cookies for that
@anantjoshi2131
@anantjoshi2131 3 года назад
serverside
@SHADAN.__.KHAN077
@SHADAN.__.KHAN077 2 года назад
Thanks
Далее
Laravel 8 tutorial - Flash Session | Example
11:44
Просмотров 25 тыс.
Ozoda - Lada (Official Music Video)
06:07
Просмотров 4,4 млн
Сказала дочке нет!
00:54
Просмотров 215 тыс.
React User Login and Authentication with Axios
31:37
Просмотров 561 тыс.
Laravel 8 tutorial - Save Data in Database
12:22
Просмотров 95 тыс.
Laravel 8 tutorial - Localization | locale
13:10
Просмотров 56 тыс.
Session Management in Laravel - Beyond the Basics
11:30
How to create Custom Login Registration in Laravel
1:21:57
Ozoda - Lada (Official Music Video)
06:07
Просмотров 4,4 млн