Cookies in Angular Cookies are small packages of information that can be temporarily stored/saved by your browser and websites which are using cookies for multiple things. Cookies are used in multiple requests and browser sessions and can store your account information used by authentication for example. ------------------------------------------------------------ ==> Size of Cookies: They are often not more than a few kilobytes per cookie. ----------------------------------------------------------------- ===> How to install Cookies We already have an NPM package for Angular called 'ngx-cookie-service' that can be used for cookie use. npm install ngx-cookie-service ------------------------------------------------------ ===> How to use Cookies 1. import { CookieService } from 'ngx-cookie-service'; 2. import service in app.module.ts providers: [ CookieService ] 3. Inject Cookies service in constructor and set private variable constructor( private cookieService: CookieService ) { this.cookieService.set( 'Test', 'Hello World' ); // Set Cookies Value this.cookieValue = this.cookieService.get('Test'); // Get Cookies Value } ----------------------------------------------------------- ===> How to Delete Cookies cookieService.delete('test'); // delete single data from cookies cookieService.deleteAll(); // delete all cookies data --------------------------------------------------------- ===> Method of Cookies 1. Check :- Used to check cookies exits or not 2. Set :- Used to set the value in cookies with name 3. Get :- Used to return the single value of stored cookies name 4. Get All :- Used to return a value object of all cookies 5. Delete :- Used to delete the single cookies value with the given name 6. Delete All :- Used to delete all the cookiesAll Rights Reserved