Russell Codd wrote:
I have some links in the menu block of my mobile app where I surround them in an IF widget with a condition of GetUserId() <> NullIdentifier() to see if a user is logged in or not.
That way the user does not see links which are not appropriate for them, as the app can be used by both registered and anonymous users.
However, it looks like the GetUserId() must somehow cache the value of the user id, even if that user is not logged in. We can test this as follows:
- Create a link that is only visible to a logged in user with GetUserId() <> NullIdentifier().
- Click that link to a page with the role Registered.
- Page is not loaded, instead you are sent to the login page.
So, after some explanation, my question is as follows:
How can I reliably tell if a user is logged in to the app? Is there a better condition I can use in the IF widget?
Hi Russel,
I am having same scenario in my application. I am explaining what i did, may be it will help you:
I have create one boolean parameter with false value.
Assigned it to the Visible property of that link.
By default all links will be hidden.
OnReady of my page i am checking if the user is logged in then i am updating the value of boolean variable.
It is not giving me any issue.
Regards,