@bobyui wrote:
Hi, I have this code
login(mail: string, password: string) {
this.loadingCtrl.create({ message: "Authenticating..." }).then((overlay)=> { this.loading = overlay; this.loading.present(); }); return this.httpClient.post(this.server + '/login?_format=json', JSON.stringify({ name: name, pass: password, }), {headers: { 'Content-Type': 'application/json' }} ).subscribe( data => { console.log(data); this.storage.ready().then(()=>{ this.storage.set('userdata',data); this.storage.get('userdata').then(value=>{ console.log(value); }); }); }, error => { console.log(error); this.loading.dismiss(); if(error.error['message']) { this.alertService.presentToast(error.error['message']); } } ); }
but somehow the cookie was never replaced, it is always using the 1st time cookie and when I refresh the localhost:8100 then it will replaced the cookie, but this shouldnt work this way I believe, am I missing any steps?
Posts: 1
Participants: 1