Quantcast
Channel: Ionic Forum - Latest topics
Viewing all articles
Browse latest Browse all 70445

Login cookie never replaced the 1st time?

$
0
0

@bobyui wrote:

Hi, I have this code :slight_smile:

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

Read full topic


Viewing all articles
Browse latest Browse all 70445

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>