Local Storage & Session Storage [ with Code Examples ]

แชร์
ฝัง
  • เผยแพร่เมื่อ 21 พ.ย. 2024

ความคิดเห็น • 177

  • @akshaymarch7
    @akshaymarch7  5 ปีที่แล้ว +20

    If interested, also check out other videos in “Cracking the Frontend Interview” Series here: th-cam.com/video/VHnILgmErM4/w-d-xo.html

    • @jagdishbhandariya5851
      @jagdishbhandariya5851 4 ปีที่แล้ว

      Your videos are full of knowledge. You could use some graphics to make your videos a bit more 'professional'. Although this style of face to face explanation is also great. Thanks.

    • @kalpanagupta6166
      @kalpanagupta6166 3 ปีที่แล้ว

      ```
      var d = new Date()
      var x = JSON.stringify(d)
      JSON.parse(x)
      ```
      JSON.stringify doesn't work for date objects

  • @TheUltimateTrainJourney
    @TheUltimateTrainJourney 4 ปีที่แล้ว +14

    5 saal ho gaye storage use karte karte but itna detail me kabhi nahi sikha great

  • @ser-17-p1v
    @ser-17-p1v 2 หลายเดือนก่อน +4

    today i have given a frontend interview, the interviewer ask this questions
    1. how to store data in HTML
    2. what is LOCAL Storage and Session Storage
    3. absolute and relative in CSS
    4. Rest API
    5. how to extract data , coming in json as string
    i heard about that cookies, browser store some data but don't know about local storage and and session storage , so i just try to answer it but not able to give proper answer.
    i beginner in frontend development i also don't know about Rest API, i think they gone ask questions related to my project but not.
    i did 2 projects with React js and know basis thing in Javascript
    - now i need to learn the things in more detail.
    i first time tried to write that big common on any youtube video, i usually don't like to comment, i know i also did mistakes while writing the comment.

  • @tejalbhavsar4610
    @tejalbhavsar4610 4 ปีที่แล้ว +15

    watched so many videos about local , session storage but no one cover like this clear covered and neat thanks

  • @himangshuchowdhary4369
    @himangshuchowdhary4369 3 ปีที่แล้ว +3

    I think the fact that you use less technical jargons, makes your videos more understandable! As they say.. one can only explain well if he/she has understood it well in the first place.

  • @Hemant-Singh-31dec
    @Hemant-Singh-31dec 3 ปีที่แล้ว

    if anyone not understand some concept just watch it again and again , this only video cover all the concept . thanks you akshay sir to provide this concept in short or more understandable form , plz upload videos on some confusion topic

  • @rajasthani_rang
    @rajasthani_rang 3 ปีที่แล้ว +1

    I like you teaching skill, clear voice, clear voice easy to understand... 👍👍👍👍👍

  • @VinitKumar-xk1dd
    @VinitKumar-xk1dd 3 หลายเดือนก่อน +2

    Now this concept gets stored in my brain's Local Storage. Thankyou 🙏

  • @itsnewsgalaxy5626
    @itsnewsgalaxy5626 9 หลายเดือนก่อน +1

    Thanks a lot bro.... I was facing difficulties from past 4 days

  • @nimishapundhir9684
    @nimishapundhir9684 3 ปีที่แล้ว +8

    The way you explain every concept is appreciable like short and crisp and in a very clear way so that every one understands it so easily. Thank you so much ✌️

  • @mayankgupta7988
    @mayankgupta7988 4 ปีที่แล้ว +4

    Thanks for the video.I cleared first round because of this.

  • @sireeshakuna5686
    @sireeshakuna5686 3 ปีที่แล้ว

    You are the master of JavaScript 🙏

  • @krishnasraves
    @krishnasraves 5 ปีที่แล้ว +4

    I like the way you of explanation, Good Job Akshay!
    I want to add an example which you told in video in the Last with using a function, Please correct me if it is wrong. May be it well helps to other as per coding std.
    function createItem (dataKey, DataValue) {
    localStorage.setItem(dataKey, JSON.stringify(DataValue));

    }
    var list = {"Krishna" : "Dandu"};
    var list2 = {"Siva" : "Konal"};
    createItem("StoreList", list);
    createItem("StoreList2", list2);

  • @aasthawadhwa3291
    @aasthawadhwa3291 4 ปีที่แล้ว +7

    Commendable work done! Clear, crisp and covered all major aspects of storage. Thankyou.

  • @codingwithgraceandtruth2456
    @codingwithgraceandtruth2456 2 ปีที่แล้ว +1

    Value for time with high quality content. Thank you for your effort.

  • @abhisheksarmah660
    @abhisheksarmah660 3 ปีที่แล้ว +7

    The content is very helpful. And, yes I am preparing for machine coding round 😊
    Just point out, while I was writing a blog about this stuff, I did found in MDN docs that, the session storage can maximum store 5mb data, which you mentioned as minimum in your video.

  • @PiyushSingh-mt2tb
    @PiyushSingh-mt2tb 3 ปีที่แล้ว +1

    Bro! This is how you explain it to newbies! Great video!

  • @ravithakor6238
    @ravithakor6238 3 ปีที่แล้ว

    you also told the trick to store object as string and how to fetch it as object. not all youtubers do this awesome

  • @channaveerhakari7319
    @channaveerhakari7319 2 ปีที่แล้ว +6

    Usecase: Recently in one of the projects, I used *localStorage* to improve the performance of the web application. The *REST API server* is in a different country, *FrontEnd server* is in a different country & *Database server* is also in a different country.
    Basically, when the user SignIn most parts of the application I show the analytics data and aggregated data and it gets updated every midnight. So when the user goes to these pages I store the analytics data to the localStorage, also I use caching for my frontend API calls so that even if the user deletes the browser's local storage data then it fetches from the server cached data. This really improved the page-load of my application.

    • @harshneetsingh5267
      @harshneetsingh5267 2 ปีที่แล้ว

      sabh upr se gaya bhai

    • @channaveerhakari7319
      @channaveerhakari7319 2 ปีที่แล้ว

      @@harshneetsingh5267 in simpler words. Assume that you have vegetables in house, if it's gets over then you go to near by shop and buy, if you don't find it there then you have to go to market and purchase, once you purchase you will then store in your house.
      Similarly in my application if the data is stored in local storage it will be fetched furst, if no data exists then pulls from the frontend server, if even there it doesn't find then it will go to my API server to get the data.
      Once i get this fresh data i will again cache in my frontend server and my local storage.

    • @harshneetsingh5267
      @harshneetsingh5267 2 ปีที่แล้ว

      @@channaveerhakari7319 deng Nice work buddy I’m learning JAVASCRIPT and good resources to clear the concepts ? And should I go for a framework react or jquery and all

    • @channaveerhakari7319
      @channaveerhakari7319 2 ปีที่แล้ว +1

      @@harshneetsingh5267 i would suggest you to stick with javascript first and once you get confidence with it. You can switch to libraries usage like jQuery and others. Now do some projects so that it makes your basic strong.
      Once your familiar with the basics you can learn advanced libraries/frameworks like ReactJs / VueJs / Angular. Concentrate on any one framework
      And do some projects on this. It will help you a lot to get a good grip.

    • @harshneetsingh5267
      @harshneetsingh5267 2 ปีที่แล้ว

      @@channaveerhakari7319 how will I get to know that my basics are cleared Like .. what type of project should I make so that it covers all the concept

  • @saranyaasokan1630
    @saranyaasokan1630 4 ปีที่แล้ว +1

    your videos are easily understandable ,well explained super....Thanks.

  • @satendravishwakarma4811
    @satendravishwakarma4811 3 ปีที่แล้ว

    Hey man, you are doing a great Job. I wish i could have watched this video before my last interview.. i could have cracked the interview...

  • @shubhamh7451
    @shubhamh7451 3 ปีที่แล้ว

    Dayummm, never thought of making custom functions. Thank you!!!!!!

  • @gharchaaaswaad4658
    @gharchaaaswaad4658 2 ปีที่แล้ว

    Way of the explanation is Superb! Thanks

  • @kashifalikhan4420
    @kashifalikhan4420 2 ปีที่แล้ว +1

    You are like Javascript Khazana :)

  • @lennonbenedictjansuy
    @lennonbenedictjansuy 3 ปีที่แล้ว

    The audio is very amazing!

  • @shacodes
    @shacodes 5 ปีที่แล้ว +1

    i read the whole description and i know it will be v good video

  • @sourishdutta9600
    @sourishdutta9600 5 ปีที่แล้ว +6

    Hey akshay big fan of yours, Thanks for you amazing videos. I will request you to make videos on micro front-end architecture with docker container, it will be very helpful as for the larger application running on Angular or React we need to split our works so what will be the architecture , please discuss this type of things. Thanks again. You great 👍👌

  • @Under1Umbrella
    @Under1Umbrella 5 ปีที่แล้ว +4

    very informative.. Thank you for explaining so well.

  • @dineshkumar-rd4bp
    @dineshkumar-rd4bp 5 ปีที่แล้ว +3

    Hi bhai !!! I like your videos it's useful and made us clear on some useful doubts, keep doing it...and could pls share us logical part of interview experience too, I hope u doing great !!!

  • @mohitnegi724
    @mohitnegi724 5 ปีที่แล้ว +1

    I Loved It Bhai. Thanks For Clearing My Local Storage Doubts. Keep Spreading Knowledge .

  • @sankarsan
    @sankarsan 3 ปีที่แล้ว

    Very well explained Akashay. Keep up the good work.

  • @Gurpreetsful
    @Gurpreetsful 4 ปีที่แล้ว +1

    Very informative and easy to understand 😇

  • @biju1278
    @biju1278 2 ปีที่แล้ว

    Hai Akshay, you are doing awesome work. Good keep going, I have some suggestions as follows.
    I found your videos are not arranged in proper way in play lists so that even a beginner can go through it. and include more code examples so that anyone could use it inside code like in this video you are you are entering commands in console why cant you use vs code and write code inside so that even a beginner can understand use it his code
    I would like to know about open source projects. how to contribute to them and make money out from this. a lot of people are doing it. why cant you make a series about open sourcing. I think it will be interesting and informative.

  • @yampolskie
    @yampolskie 3 ปีที่แล้ว

    Crystal clear explanation, thank you very much for sharing your knowledge!

  • @0787rajesh
    @0787rajesh 5 ปีที่แล้ว +14

    Could you please cover shallow copy and deep copy using JavaScript? If possible

  • @priyanshimahajan3949
    @priyanshimahajan3949 3 ปีที่แล้ว +3

    Really appreciate your work! 🙌 keep going!
    I have a doubt though, will we be able to access local and session storage in incognito mode?
    Also if we try to access local storage in a new window of the same browser, will it work?
    What happens if we close the browser, will it still hold the data or will it vanish?

  • @deeptinayak7740
    @deeptinayak7740 3 ปีที่แล้ว

    Thanks alot for such detailed explanation about storage.

  • @sudiptasaha8905
    @sudiptasaha8905 3 ปีที่แล้ว

    Seriously Bro, your explanations are too good. I have become a fan of yours. This is the exact style with which I explain the interviewers after watching your videos. Please make more videos on Front End interview Questions.

  • @vinothkumarv9722
    @vinothkumarv9722 3 ปีที่แล้ว

    Vinoth love >> akshay :
    Hi bri again I just revieced again today for rrevicing evicin voicing.... 😍😍😍😍😍😍

  • @sakshamchhatkuli271
    @sakshamchhatkuli271 2 ปีที่แล้ว

    1)LocalStorage and sessionStorage are the same,but LocalStorage data will be persistent untill and unless we decided to clear it while sessionStorage will be lost when we close the web browser.
    2) We store data in local storage for user specific data.

  • @pradnya2763
    @pradnya2763 8 หลายเดือนก่อน

    ❤ you written the notes in description😭

  • @rajendrakumar729
    @rajendrakumar729 3 ปีที่แล้ว

    @Akshay thank you very much explaining the concepts so much ease :)

  • @girinirbhay
    @girinirbhay 3 ปีที่แล้ว

    Voice of this video is low. But yes very nicely explained

  • @SecretSantaSanta
    @SecretSantaSanta 3 ปีที่แล้ว

    Your videos are awesome.. The way you explain everything is so simple and clear.
    For storing user information in local storage, is it secure? For example if I am storing user info and token in local storage is it the right way?
    Thanks in advance.

  • @lifewidabi
    @lifewidabi 3 ปีที่แล้ว

    well explained huge respect for you.

  • @karukkuvelraja8179
    @karukkuvelraja8179 4 ปีที่แล้ว

    Keep Doing Bro.... Awesome & Good video quality.....

  • @FunVideo7882
    @FunVideo7882 2 ปีที่แล้ว

    the content very awosome.. u are so good sir

  • @shankar8816
    @shankar8816 2 ปีที่แล้ว

    first tym on ur videos.. fan now

  • @beinghappy9223
    @beinghappy9223 ปีที่แล้ว

    Thanks for the amazing explanation .

  • @aer0449
    @aer0449 ปีที่แล้ว

    Thank you bade bhaiya ❤️

  • @adnancerttrain
    @adnancerttrain 3 ปีที่แล้ว

    Hi sir Akshy Saini, Thank u so much Great work.

    • @akshaymarch7
      @akshaymarch7  3 ปีที่แล้ว +1

      Watch `Namaste JavaScript` web series on my channel. You will love it. ❤️

  • @Aditi6501
    @Aditi6501 2 ปีที่แล้ว

    Amazing explanation

  • @rahulrollno.-0689
    @rahulrollno.-0689 ปีที่แล้ว

    woow kya video hai very fantastic isme toh bada maja aaya

  • @cdougy
    @cdougy 4 ปีที่แล้ว

    This was a great video! Excellent thorough explanation. I fully understand how this works now. I think you lost me towards the end. How would you go about writing a function to handle those actions?

    • @saurabrakshit405
      @saurabrakshit405 3 ปีที่แล้ว +1

      Just like this if I'm not wrong
      for set the data to storage:-
      function setLocal(){
      var input = localStorage.setItem("very","special");
      console.log(input);
      }
      setLocal()
      for set the data to storage:-
      function getLocal(){
      var output = localStorage.getItem("very")
      console.log(output);
      }
      getLocal()
      function gotLocal(){
      const name = {name:"bobby"};
      var a = localStorage.setItem("call",name)
      console.log(a);
      var b = localStorage.setItem("call-copy",JSON.stringify(name))
      console.log(b);
      var c = JSON.parse(localStorage.getItem("call-copy2"))
      console.log(c);
      }
      gotLocal()

  • @Vikaskumar-ur5di
    @Vikaskumar-ur5di 2 ปีที่แล้ว

    thanks for sharing good video & amazing concept

  • @leonredman9317
    @leonredman9317 4 ปีที่แล้ว

    Great video, very clear instructions

  • @naufilshaikh09
    @naufilshaikh09 4 ปีที่แล้ว

    Very well explained. Very useful. 👌

  • @Zaheer__zk40
    @Zaheer__zk40 7 หลายเดือนก่อน

    Greatly explained

  • @Medes_music
    @Medes_music ปีที่แล้ว

    Thanks best teacher🙏🏽🙏🏽 god bless ya❤🌹

  • @karthikeyan_vellingiri
    @karthikeyan_vellingiri 4 ปีที่แล้ว +2

    very useful brother !! Thank you so much.

  • @rajesht9694
    @rajesht9694 4 ปีที่แล้ว +1

    Nice explanation

  • @pawansahu8605
    @pawansahu8605 3 ปีที่แล้ว

    I really like your video, it is very helpful

  • @Anything-gm2pn
    @Anything-gm2pn 2 ปีที่แล้ว

    Thnk u sir. your content help hacker too.

  • @ariesgaming4580
    @ariesgaming4580 6 หลายเดือนก่อน

    Thank you brother that helps a lot❤

  • @persmultimediadesigntutori1293
    @persmultimediadesigntutori1293 2 ปีที่แล้ว

    Interesting video - and very usefull info. Perhaps your idea could speed up even a headless WordPress ...

  • @astharana3074
    @astharana3074 9 หลายเดือนก่อน

    great explanation🙌

  • @SA-oj3bo
    @SA-oj3bo ปีที่แล้ว

    I can imagine many usecases for cookies, but none for localstorage or sessionstorage. What are typical usecases for localstorage and sessionstorage? Grtz.

  • @harishs7384
    @harishs7384 3 ปีที่แล้ว

    thanks a lot, understood CORS

  • @anshusingh7320
    @anshusingh7320 3 ปีที่แล้ว

    Thank you so much for sharing this! Very helpful.

  • @umangmalhotra1222
    @umangmalhotra1222 4 ปีที่แล้ว

    Where do you usually shoot your videos? Is this your home or office? The place sounds so good, with no extra sound noise.

  • @ankiitsharma
    @ankiitsharma ปีที่แล้ว

    brother DOM manipulation pe leke ajao video 1 ya 2 hr ki and if possible React bhi

  • @OmDharmoRakshatiRakshitah
    @OmDharmoRakshatiRakshitah 2 ปีที่แล้ว

    Please add cookies and indexeddb also with this will be helpful.

  • @ravinivangune
    @ravinivangune 5 ปีที่แล้ว +1

    Hi Akshay, could you please suggest how to focus on datastructure and algo along with web development, and which language should i use for practice for data structure. As already we need to learn abound javscript and another framework so on which language should we focus for ds and algo... Thanks in advanced you are doing really great work...

    • @ANKITPRAKASHCSE
      @ANKITPRAKASHCSE 5 ปีที่แล้ว +3

      Start with arrays, stack, queue, linklist, and graphs, greedy algorithm, divide and conquer, backtracking. Plan your study, split hours between ds Algo, JavaScript, and coding applications. Refer MDN and follow blog post ,medium articles and videos. It is continuous learning.
      Since you are practicing in JavaScript, try to solve in JS only as programming language is not a constrain. I personally prefer java as it's object oriented, practicing D's Algo in java helped me learning oops concepts. Again choice is yours. Coming in framework, react is popular in terms of jobs, so start with react and learn by coding, seeing others code on GitHub.

  • @JS-zm5se
    @JS-zm5se 3 ปีที่แล้ว

    Again best explaination....

  • @mohitkhandar8060
    @mohitkhandar8060 3 ปีที่แล้ว

    osm video bro you have good skill

  • @FoodieKing
    @FoodieKing 5 ปีที่แล้ว +1

    Brother , damn gud video ...cheers to you 😄😄

  • @krishaengineer9754
    @krishaengineer9754 3 ปีที่แล้ว +2

    Hi Akshay, is this series (cracking frontend interview) complete or more videos to come? Expecting System Design, DS Algo etc. Love your videos 👍

    • @akshaymarch7
      @akshaymarch7  3 ปีที่แล้ว +2

      Check out, `Namaste JavaScript` video series playlist on my channel. It covers in depth JS and interview questions also, I'm sure Krisha, you'll love it - th-cam.com/video/pN6jk0uUrD8/w-d-xo.html

    • @krishaengineer9754
      @krishaengineer9754 3 ปีที่แล้ว

      @@akshaymarch7 Yes, I am following it. Your explanation is just the kind I was looking for!!! :)

  • @Ks-oj6tc
    @Ks-oj6tc 2 ปีที่แล้ว

    Well explained

  • @ManojKumar-qe5dd
    @ManojKumar-qe5dd 5 ปีที่แล้ว +1

    Great Content 👍

  • @manikantajupudi4129
    @manikantajupudi4129 3 ปีที่แล้ว

    Thanks, Akshay.

  • @DS-zr9gv
    @DS-zr9gv 4 ปีที่แล้ว +1

    Thank you so much Akshay for this :)

  • @mohaklondhe3020
    @mohaklondhe3020 3 ปีที่แล้ว

    Please make a vid on Authentication/Authorization. using SessionID, JWT. What is OAuth, etc!!!

  • @HIMANSHUSHARMA-eh5wv
    @HIMANSHUSHARMA-eh5wv 5 ปีที่แล้ว +2

    Sir if possible,please make a video on indexed data locally on indexedDB from a API.

  • @ShurizzX
    @ShurizzX 3 ปีที่แล้ว

    You are awesome man.....

  • @weblearning1513
    @weblearning1513 4 ปีที่แล้ว +1

    great interview tips bro. why not create a complete web developer tutorial with example (HTML,CSS,jQuery and Javascript)

  • @javohirmurodov4670
    @javohirmurodov4670 2 ปีที่แล้ว

    valuable contents

  • @12vvs
    @12vvs 4 ปีที่แล้ว +1

    Great Article!

  • @Shredder220
    @Shredder220 4 ปีที่แล้ว

    Very informative..

  • @indianinvestor1301
    @indianinvestor1301 2 ปีที่แล้ว

    Do videos on react js bro ❤️❤️

  • @shobhitsrivastava2123
    @shobhitsrivastava2123 3 ปีที่แล้ว +1

    Great video!

  • @poojakamble3643
    @poojakamble3643 3 ปีที่แล้ว

    thankyou so much it was really helpfull

  • @noaakshay
    @noaakshay 3 ปีที่แล้ว

    Please make a video on how you built your portfolio website, And I am not able to download your resume which you had uploaded on your portfolio website.

  • @vishalchauhan9832
    @vishalchauhan9832 3 ปีที่แล้ว +1

    Thank You sir !

  • @shwetanikam7990
    @shwetanikam7990 3 ปีที่แล้ว

    great vedio

  • @pujajharait6969
    @pujajharait6969 4 ปีที่แล้ว

    can you please make a video on how to use google apis in javascript such as-location,direction,place,road etc

  • @jasnanajeem9121
    @jasnanajeem9121 5 ปีที่แล้ว +1

    Taaaaankyou thankyewww thankyouuuuuuuuu🙏🙏🙏🙏🙏💟

  • @debjeetnandi6145
    @debjeetnandi6145 2 ปีที่แล้ว

    Many Thanks!!!

  • @harishkulkarni9645
    @harishkulkarni9645 5 ปีที่แล้ว

    Awesome content!

  • @rohitgoyal5138
    @rohitgoyal5138 3 ปีที่แล้ว

    Hi Akshay
    Can you please make a video on indexedDB?

  • @vitalvisions4U
    @vitalvisions4U 3 ปีที่แล้ว +1

    One observation- user A logged in to web app, stored the username in localstorage inside login function. Logged out.
    User B logged in , the username of B should be overwritten and stored in localstorage. But in dev too Application tab- it still shows the username A. However if I clear browser cache and try whole process again- it works. Any idea why this would be happening. Or how to handle it.