Skip to main content

Difference between webstorage, cookie, local storage & session storage

WebStorage

The Window object implements the WindowLocalStorage and WindowSessionStorage objects which has localStorage(window.localStorage) and sessionStorage(window.sessionStorage) properties respectively. These properties create an instance of the Storage object, through which data items can be set, retrieved and removed for a specific domain and storage type (session or local). For example, you can read and write on local storage objects as below

localStorage.setItem('logo', document.getElementById('logo').value);

localStorage.getItem('logo');

What are the differences between cookie, local storage and session storage

Below are some of the differences between cookie, local storage and session storage,

FeatureCookieLocal storageSession storage
Accessed on client or server sideBoth server-side & client-sideclient-side onlyclient-side only
LifetimeAs configured using Expires optionuntil deleteduntil tab is closed
SSL supportSupportedNot supportedNot supported
Maximum data size4KB5 MB5MB

Comments

Popular Posts

TechBytes on Linux

This is a growing list of Linux commands which might come handy for the newbies of Linux. 1. Found out i had to set the date like this:    # date -s 2007.04.08-22:46+0000 2. Mounting     sudo mount -t cifs // < pingable_host_or_ip > / < win_share_name > /build -o user= ,domain= ,uid=string,gid=string 3. To install linux packages from internet (ubuntu only)     apt-get install 4. To determine what ports the machine is currently listening on     netstat -an | grep -i listen | less 5. Find in files in Linux     find . | xargs grep 'string' -sl 6. To become superuser/root     sudo -i 7. To find a running process using name ps -aef | grep "searchstring" 8. Alt + F2 opens run window in RHEL 9. To access windows share from linux smb:// /d$ 10. To know the last reboot date & time $ last reboot | head -1 11. To install RPM packages in RHEL rpm -ivh 12. To un-install RPM package in RHEL rpm -e 13. To display Linux Kerne

How to change the default pdf viewer application in your Mac or MacBook

  To  set  a  PDF viewer  as the  default  on  Mac  OS X: Select any  PDF  file from Finder. Control-click to open the menu. ...  Choose Get Info from the menu that opens. ...  From the Open with: section in the new window that opens, select your preferred application, such as Adobe  Reader  or Preview. ...  Click the  Change  All button.

ಮ್ಯಾಕ್ ಬುಕ್ ಮತ್ತು ವಿನ್ಡೋಸ್ ಲ್ಯಾಪ್ ಟಾಪ್ ನಲ್ಲಿ ಎಲ್ಲ ಆಪ್ ಗಳಲ್ಲಿ ಕನ್ನಡ ಟೈಪ್ ಮಾಡುವುದು ಹೇಗೆ ?? How to type kannada on any app in Mac OS and Windows laptops

 ಮ್ಯಾಕ್ ಬುಕ್ ನಲ್ಲಿ ಕನ್ನಡ ದಲ್ಲಿ ಟೈಪ್ ಮಾಡಲು ಲಿಪಿಕ ಎನ್ನುವ ಈ ಕೆಳಗಿನ ಲಿಂಕ್ ಅನ್ನು ಕ್ಲಿಕ್ ಮಾಡಿ .pkg ಫೈಲ್ ಅನ್ನು ಡೌನ್ ಲೋಡ್ ಮಾಡಿ ಅದನ್ನು ಇನ್ಸ್ತಾಲ್ ಮಾಡಿಕೊಳ್ಳಿ. ಇನ್ಸ್ತಾಲ್ ಮಾಡಿದ ಮೇಲೆ ಅಪ್ಪ್  ಅನ್ನು ಒಪೆನ್ ಮಾಡಿ.    ಲಿಪಿಕಾ ಆಪ್    ಟಾಸ್ಕ್  ಬಾರ್ ನಲ್ಲಿ 'A' ಎನ್ನುವ ಐಕಾನ್ ಅನ್ನು ಕ್ಲಿಕ್ ಮಾಡಿ. ಲಿಪಿಕಾ ಐಮ್ಈ ಅನ್ನು ಕ್ಲಿಕ್ ಮಾಡಿ. ಕನ್ನಡ ಭಾಷೆಯನ್ನು ಆಯ್ಕೆ ಮಾಡಿ.  ಆ ನಂತರ ಯಾವುದೇ ಮ್ಯಾಕ್ OS ಆಪ್ ನಲ್ಲಿ ನೀವು  ಕನ್ನಡದಲ್ಲಿ ಟೈಪ್ ಮಾಡಬಹುದು.  ಕೇವಲ ಕ್ರೊಮ್ ವೆಬ್ ಬ್ರೌಸರ್ ನಲ್ಲಿ ನಿಮಗೆ ಕನ್ನಡ ಟೈಪ್ ಮಾಡಬೇಕಾದಲ್ಲಿ ಈ ಕೆಳಗಿನ ಲಿಂಕ್ ಅನ್ನು ಕ್ಲಿಕ್ ಮಾಡಿ  ಗೂಗಲ್ ಇನ್ಪುಟ್ ಮೆಥಡ್  (Google Input Method) ಗೂಗಲ್ ಕ್ರೊಮ್ ಎಕ್ಸ್ ಟೆನ್ಷನ್ ಅನ್ನು ಇನ್ಸ್ತಾಲ್ ಮಾಡಿಕೊಳ್ಳಿ. ಅದನ್ನು ಒಪೆನ್ ಮಾಡಿ ಕನ್ನಡ ಭಾಷೆ ಯನ್ನು ಆಡ್ ಮಾಡಿಕೊಳ್ಳಿ.  ವೆಬ್ ಬ್ರೌಸರ್ ನಲ್ಲಿ ನಿಮಗೆ ಕನ್ನಡ ಟೈಪ್ ಮಾಡಬೇಕಾದಲ್ಲಿ ಈ ನೀಲಿ ಕೀ ಬೋರ್ಡ್ ಐಕಾನ್ ಅನ್ನು ಬುಕ್ಮಾರ್ಕ್ ಬಾರ್ ನಲ್ಲಿ ಕ್ಲಿಕ್ ಮಾಡಿ ಕನ್ನಡ ಫೊನೆಟಿಕ್ ಆಪ್ಷನ್ ಅನ್ನು ಆಯ್ಕೆ ಮಾಡಿ.  ಕನ್ನಡ ಟೈಪಿಂಗ್ ಅನ್ನು ಮ್ಯಾಕ್ ಬುಕ್ ಮತ್ತು ವಿನ್ಡೋಸ್ ಲ್ಯಾಪ್ ಟಾಪ್ ಬ್ರೌಸರ್ ನಲ್ಲಿ ಆನಂದಿಸಿ.  ಮೈಕ್ರೊಸಾಫ್ಟ್  ವಿನ್ಡೋಸ್ ನಲ್ಲಿ ಯಾವ ಆಪ್ ನಲ್ಲಿ ಬೇಕಾದರೂ ಕನ್ನಡ ಟೈಪ್ ಮಾಡಲು ನಿಮಗೆ ಎರಡು ಆಯ್ಕೆ ಇವೆ: ೧. ಫೊನೆಟಿಕ್ ಕನ್ನಡ ಟೈಪ್ ಮಾಡಲು