Issue with file app.component.ts in my app

#1

Hello guys
I am building an app and stucked somewhere in app.ccomponent.ts
I know its possible just wondering if you guys can give me some idea how to achieve this

So i am using a splitpane for sidebar and kept codes of sidebar in app.html because i want it to be accessible on each pages and at the top of the side bar i have kept some user profile info like name and profile pic etc and m getting these information after login or signup by using localstorage

after login there is profile info in my localstorage and even i can access it everywhere but still it is not updating sidebars profile info
although it is updating but when i refresh my browser or reload in ionic lab I havent tested it in mobile yet but m sure if it is not working here it wont make any change on device either.

this is sidebars image

How can i update this after login or signup?

app.component.ts code:
I have kept this code in constructor -

if(localStorage.getItem(‘cookie_data’)){
const data=JSON.parse(localStorage.getItem(‘cookie_data’));
this.fetched_info=data.userData;
if(this.fetched_info.gender==‘Female’){
this.img=‘profile-image-girl.jpg’;
} else{
this.img=‘profile-image-men.jpg’;

       }
     } else{
  this.rootPage=LoginPage;

                

     }