Click here to Skip to main content
16,020,345 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi,



am developing a WP8 app using C# and xaml,

In my app there is an sign in page, I have my custom login for my app

If the user is signed into the app once then it should not ask user again for the sign in.

how to achieve that?
Posted
Comments
Sergey Alexandrovich Kryukov 6-Nov-13 1:03am    
Not clear. Not asking again — in what life cycle? What is the problem?
—SA

1 solution

You can save the User Login information to IsolatedStorage. Each user has unique name, I mean there is no any duplication in UserName. So with the help of UserName you can store the information to IsolatedStorage.

For e.g.

C#
public void SaveToStorage(string UserName)
{
    if (IsolatedStorageSettings.ApplicationSettings.Contains(UserName))
    {
        return;
    }
    IsolatedStorageSettings.ApplicationSettings["LoginStatus"] = UserName;
    IsolatedStorageSettings.ApplicationSettings.Save();
}

public bool GetFromStorage()
{
    if (IsolatedStorageSettings.ApplicationSettings.Contains(LoginStatus))
    {
        return true;                     // User is already Login
    }
    return false;
}


With the help of above two function you can check this on Application Activated or Launching event whether user is already login or not.
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900