How to pass data between two different angular application in angular7

 implemented this way but not working in live
        
        if you are using Angular 2+ you can use cookies Step -1 install npm install ngx-cookie-service for both the apps or can install globally Step 2 .
        
        App1 - > app.module.ts
        
        import { BrowserModule } from '@angular/platform-browser';
        import { NgModule } from '@angular/core';
        
        import { AppRoutingModule } from './app-routing.module';
        import { AppComponent } from './app.component';
        import {CookieService} from 'ngx-cookie-service'
        
        @NgModule({
          declarations: [
            AppComponent
          ],
          imports: [
            BrowserModule,
            AppRoutingModule
          ],
          providers: [CookieService],
          bootstrap: [AppComponent]
        })
        export class AppModule { }
        App1 - app.component.ts
        
        import { Component } from '@angular/core';
        import {CookieService} from 'ngx-cookie-service'
        
        
        @Component({
          selector: 'app-root',
          templateUrl: './app.component.html',
          styleUrls: ['./app.component.css']
        })
        export class AppComponent {
          title = 'my-first-project';
        
          constructor(public cookieService:CookieService){
        
          }
        
          goToNextPage(){
        
          this.cookieService.set("my-key","yourkey")
          }
        
        }
        App2 - app.module.ts
        
        import { BrowserModule } from '@angular/platform-browser';
        import { NgModule } from '@angular/core';
        
        import { AppRoutingModule } from './app-routing.module';
        import { AppComponent } from './app.component';
        import {CookieService} from 'ngx-cookie-service'
        
        
        @NgModule({
          declarations: [
            AppComponent
          ],
          imports: [
            BrowserModule,
            AppRoutingModule
          ],
          providers: [CookieService],
          bootstrap: [AppComponent]
        })
        export class AppModule { }
        App2 - app.component.ts
        
        import { Component } from '@angular/core';
        import {CookieService} from 'ngx-cookie-service'
        
        
        @Component({
          selector: 'app-root',
          templateUrl: './app.component.html',
          styleUrls: ['./app.component.css']
        })
        export class AppComponent {
          title = 'my-second-project';
        
          constructor(public cookieService:CookieService){
        
            alert(this.cookieService.get("my-key"))
        
          }
        }