1
00:00:00,880 --> 00:00:04,240
In this video, we'll be discussing about cookies and sessions.

2
00:00:05,110 --> 00:00:10,660
So cookies and sessions is the most, you know, the important thing and also the famous technology

3
00:00:10,660 --> 00:00:14,590
that will be using by many big companies like Amazon, Flipkart, etc..

4
00:00:15,370 --> 00:00:17,380
So what do you mean by cookies and sessions?

5
00:00:17,950 --> 00:00:25,120
So for that, let's say we're having a browser and a server.

6
00:00:27,670 --> 00:00:29,350
So let me open up and to.

7
00:00:30,610 --> 00:00:30,910
Yeah.

8
00:00:32,250 --> 00:00:33,560
And the next clearly.

9
00:00:40,450 --> 00:00:40,840
So.

10
00:00:43,190 --> 00:00:44,420
Just a second.

11
00:00:50,530 --> 00:00:52,900
So here you have a browser.

12
00:00:54,670 --> 00:00:55,330
And a sort.

13
00:00:56,580 --> 00:00:56,910
Right.

14
00:00:57,540 --> 00:01:02,610
So when you're sending that request to the server.

15
00:01:05,630 --> 00:01:06,830
Ben, my handwriting.

16
00:01:07,550 --> 00:01:13,160
So when you get to get requests for the server, you'll get a response, right?

17
00:01:14,920 --> 00:01:18,670
Similarly, when you send a post request for the satellite.

18
00:01:21,730 --> 00:01:23,060
Not going to get a response.

19
00:01:24,210 --> 00:01:31,170
So, for example, consider a case like Amazon in Amazon, you will add some products to your cart,

20
00:01:31,200 --> 00:01:31,500
right?

21
00:01:31,950 --> 00:01:33,570
Relax and product to your cart.

22
00:01:34,140 --> 00:01:39,870
So after a few days whenever, if you did not complete the payment, then after a few days when you

23
00:01:39,870 --> 00:01:44,220
come back and again log in, then the data will be still present in the carts.

24
00:01:44,610 --> 00:01:45,990
So this is what cookies does.

25
00:01:46,410 --> 00:01:48,360
So they're not making a post request.

26
00:01:50,390 --> 00:01:52,010
Of adding a product to the cart.

27
00:01:52,190 --> 00:01:58,220
That means this post request will be adding, you know, adding the.

28
00:02:01,340 --> 00:02:08,600
Product that I've got so that Bush, Jeb Bush will be adding, so let me tape it, but a post request

29
00:02:08,600 --> 00:02:10,910
will be adding the product.

30
00:02:13,860 --> 00:02:14,380
The court.

31
00:02:16,520 --> 00:02:22,820
So when we added this product to the cart at this time, at this moment in time, the Amazon service

32
00:02:22,820 --> 00:02:29,690
will create a cookie that contains that data and it would end when it responds to the post request that

33
00:02:29,690 --> 00:02:35,300
Cookie gets along, gets sent along and grows and gets to preserve that cookie.

34
00:02:35,840 --> 00:02:42,650
So basically, what's happening is we are sending this post request then as a response, as a response.

35
00:02:44,110 --> 00:02:45,370
The Amazon Sidewalk.

36
00:02:47,500 --> 00:02:49,510
Will send a cookie.

37
00:02:51,800 --> 00:02:52,610
Containing.

38
00:02:56,630 --> 00:03:00,350
Containing the information on the products of the data.

39
00:03:01,070 --> 00:03:01,460
OK.

40
00:03:01,550 --> 00:03:03,340
And it tell the browser to safe.

41
00:03:04,130 --> 00:03:08,390
It will tell the browser itself that cookie.

42
00:03:10,900 --> 00:03:12,460
To same that cookie.

43
00:03:13,580 --> 00:03:13,880
Right.

44
00:03:15,280 --> 00:03:21,070
So that when we come after a long time, that Cookie still saved on that browser, on your browser.

45
00:03:21,490 --> 00:03:27,640
So the next time when we make a great request to the Amazon servers, that Cookie gets along, gets

46
00:03:28,480 --> 00:03:34,480
that cookie gets sent along with that, get requested Amazon server to allow the server to be able to

47
00:03:34,480 --> 00:03:39,160
identify who you are and see if you had any previous sessions on Amazon or not.

48
00:03:39,610 --> 00:03:44,260
So basically, again, after a few days, you are sending a request, then you are sending this cookie

49
00:03:44,260 --> 00:03:47,710
also to that Amazon server through your get request.

50
00:03:48,190 --> 00:03:52,690
And then they will see what is the data that you're having and then they'll send the data back to you.

51
00:03:53,590 --> 00:03:59,110
So there are lots of different types of cookies, but the types of cookies we are going to be looking

52
00:03:59,110 --> 00:04:02,560
at are the ones that are used to establish and maintain its session.

53
00:04:03,130 --> 00:04:03,430
OK.

54
00:04:03,640 --> 00:04:05,200
So basically, I understand what the cookies are.

55
00:04:05,200 --> 00:04:11,170
Cookies will be having some information like, for example, think about it, the cookies that you eat.

56
00:04:11,600 --> 00:04:13,090
There'll be something on the top.

57
00:04:13,090 --> 00:04:15,400
And then if you open it, there'll be some chocolate chips like that.

58
00:04:15,880 --> 00:04:21,830
So basically, that is what it would have to information and this information in the service to the,

59
00:04:21,830 --> 00:04:22,090
you know.

60
00:04:22,360 --> 00:04:27,580
But it does mean the reports are that you are accessing what data they should render to that particular

61
00:04:27,580 --> 00:04:30,040
user based on the information and the cookie.

62
00:04:30,790 --> 00:04:32,350
So that is the importance of the cookies.

63
00:04:32,920 --> 00:04:34,690
So what is session when?

64
00:04:34,690 --> 00:04:38,080
See what is session in the next video and also see how it is possible?

65
00:04:38,380 --> 00:04:38,770
Yes.

66
00:04:39,130 --> 00:04:39,580
Thank you.
