428
Views
6
Comments
Solved
GetUserId() in Mobile
Question

When I call GetUserId() in a Mobile app after having logged in, is it storing the UserId in the local storage?  Is it the UserId from the server when I call this function or is it pulling it from the local storage?

2022-11-12 11-28-30
Gonçalo Martins
Staff
Solution

Daniel Brooks wrote:

Gonçalo Martins wrote:

Daniel Brooks wrote:

When I call GetUserId() in a Mobile app after having logged in, is it storing the UserId in the local storage?  Is it the UserId from the server when I call this function or is it pulling it from the local storage?

Hi Daniel.

The entity User is server side, so if you get it from a Server action call, you'll be getting the information from the Server.


Right, I understand that initially it will have to come from the server.  Yet, let's say we log in and the user loses connectivity and goes offline.

From here, when we call GetUserId(), will it return anything or is that value stored in the local storage metadata?

I am storing User entity data in the local storage myself manually just in case it isn't, but I can't seem to find anything in the documentation regarding this.

Oh, I see your doubt.

I believe you'll find a better explanation in this article

Let us know if you have got it.


2022-11-12 11-28-30
Gonçalo Martins
Staff

Daniel Brooks wrote:

When I call GetUserId() in a Mobile app after having logged in, is it storing the UserId in the local storage?  Is it the UserId from the server when I call this function or is it pulling it from the local storage?

Hi Daniel.

The entity User is server side, so if you get it from a Server action call, you'll be getting the information from the Server.


2017-08-29 13-22-41
Daniel Brooks

Gonçalo Martins wrote:

Daniel Brooks wrote:

When I call GetUserId() in a Mobile app after having logged in, is it storing the UserId in the local storage?  Is it the UserId from the server when I call this function or is it pulling it from the local storage?

Hi Daniel.

The entity User is server side, so if you get it from a Server action call, you'll be getting the information from the Server.


Right, I understand that initially it will have to come from the server.  Yet, let's say we log in and the user loses connectivity and goes offline.

From here, when we call GetUserId(), will it return anything or is that value stored in the local storage metadata?

I am storing User entity data in the local storage myself manually just in case it isn't, but I can't seem to find anything in the documentation regarding this.

2022-11-12 11-28-30
Gonçalo Martins
Staff
Solution

Daniel Brooks wrote:

Gonçalo Martins wrote:

Daniel Brooks wrote:

When I call GetUserId() in a Mobile app after having logged in, is it storing the UserId in the local storage?  Is it the UserId from the server when I call this function or is it pulling it from the local storage?

Hi Daniel.

The entity User is server side, so if you get it from a Server action call, you'll be getting the information from the Server.


Right, I understand that initially it will have to come from the server.  Yet, let's say we log in and the user loses connectivity and goes offline.

From here, when we call GetUserId(), will it return anything or is that value stored in the local storage metadata?

I am storing User entity data in the local storage myself manually just in case it isn't, but I can't seem to find anything in the documentation regarding this.

Oh, I see your doubt.

I believe you'll find a better explanation in this article

Let us know if you have got it.


2017-08-29 13-22-41
Daniel Brooks

Gonçalo Martins wrote:

Daniel Brooks wrote:

Gonçalo Martins wrote:

Daniel Brooks wrote:

When I call GetUserId() in a Mobile app after having logged in, is it storing the UserId in the local storage?  Is it the UserId from the server when I call this function or is it pulling it from the local storage?

Hi Daniel.

The entity User is server side, so if you get it from a Server action call, you'll be getting the information from the Server.


Right, I understand that initially it will have to come from the server.  Yet, let's say we log in and the user loses connectivity and goes offline.

From here, when we call GetUserId(), will it return anything or is that value stored in the local storage metadata?

I am storing User entity data in the local storage myself manually just in case it isn't, but I can't seem to find anything in the documentation regarding this.

Oh, I see your doubt.

I believe you'll find a better explanation in this article

Let us know if you have got it.


Ah, thanks!  I didn't see this before for some reason.  So, it is available client side (local storage), and the call to GetUserId() grabs from the local storage... unfortunately it doesn't preserve any User entity data locally.

Thank you.


2022-11-12 11-28-30
Gonçalo Martins
Staff

Daniel Brooks wrote:

Gonçalo Martins wrote:

Daniel Brooks wrote:

Gonçalo Martins wrote:

Daniel Brooks wrote:

When I call GetUserId() in a Mobile app after having logged in, is it storing the UserId in the local storage?  Is it the UserId from the server when I call this function or is it pulling it from the local storage?

Hi Daniel.

The entity User is server side, so if you get it from a Server action call, you'll be getting the information from the Server.


Right, I understand that initially it will have to come from the server.  Yet, let's say we log in and the user loses connectivity and goes offline.

From here, when we call GetUserId(), will it return anything or is that value stored in the local storage metadata?

I am storing User entity data in the local storage myself manually just in case it isn't, but I can't seem to find anything in the documentation regarding this.

Oh, I see your doubt.

I believe you'll find a better explanation in this article

Let us know if you have got it.


Ah, thanks!  I didn't see this before for some reason.  So, it is available client side (local storage), and the call to GetUserId() grabs from the local storage... unfortunately it doesn't preserve any User entity data locally.

Thank you.


Just be careful with the data you'll store in your local storage, for security reasons.

Cheers,

GM


2017-08-29 13-22-41
Daniel Brooks

Gonçalo Martins wrote:

Daniel Brooks wrote:

Gonçalo Martins wrote:

Daniel Brooks wrote:

Gonçalo Martins wrote:

Daniel Brooks wrote:

When I call GetUserId() in a Mobile app after having logged in, is it storing the UserId in the local storage?  Is it the UserId from the server when I call this function or is it pulling it from the local storage?

Hi Daniel.

The entity User is server side, so if you get it from a Server action call, you'll be getting the information from the Server.


Right, I understand that initially it will have to come from the server.  Yet, let's say we log in and the user loses connectivity and goes offline.

From here, when we call GetUserId(), will it return anything or is that value stored in the local storage metadata?

I am storing User entity data in the local storage myself manually just in case it isn't, but I can't seem to find anything in the documentation regarding this.

Oh, I see your doubt.

I believe you'll find a better explanation in this article

Let us know if you have got it.


Ah, thanks!  I didn't see this before for some reason.  So, it is available client side (local storage), and the call to GetUserId() grabs from the local storage... unfortunately it doesn't preserve any User entity data locally.

Thank you.


Just be careful with the data you'll store in your local storage, for security reasons.

Cheers,

GM


Certainly!  I'm only storing Name, username, and timestamps.

Appreciate the help.

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.