Open Closed

"Remember me" not working #1447


1
viswajwalith created

ABP Framework version: v4.3.X UI type: Angular DB provider: EF Core / MongoDB Tiered (MVC) or Identity Server Separated (Angular): yes Exception message and stack trace: Steps to reproduce the issue:

Can you please provide some details about "Remember me" functionality in Login Page (Auth Server) , We dont find this is working even we select the respective checkbox. Can you please let us know if we are missing anything.

We are expecting to have Username prepopulated in login page when user selcts the "Remember me" checkbox and login successfully.


2 Answer(s)
  • 0
    maliming created
    Support Team

    hi

    The Remember me means keep your login status instead of your username.

    We are expecting to have Username prepopulated in login page when user selcts the "Remember me" checkbox and login successfully.

    You can customize the login page to get the username that already login.

    https://support.abp.io/QA/Questions/240/How-to-customize-the-login-page https://community.abp.io/articles/how-to-customize-the-login-page-for-mvc-razor-page-applications-9a40f3cd

  • 0
    albert created
    Support Team

    By the way, for those who wants to persist IDS protection keys to the database to prevent cookie invalidation after server restart, follow the steps below:

    YourProjectAccountWebModule.cs

    context.Services.AddDataProtection().PersistKeysToDbContext<AbpIoDbContext>();
    

    YourProjectDbContextModelCreatingExtensions.cs

    builder.Entity<DataProtectionKey>(b =>
    {
        b.ToTable(AbpIoDbContext.DbTablePrefix + "DataProtectionKeys");
    
        b.HasKey(x => x.Id);
    
        b.Property(x => x.FriendlyName);
        b.Property(x => x.Xml);
    });
    

    DbContext:

    public class YourDbContext : AbpDbContext<YourDbContext>, IDataProtectionKeyContext
    {
       public DbSet<DataProtectionKey> DataProtectionKeys { get; set; }
    }
    

    Add migration > Update database

    https://docs.microsoft.com/en-us/aspnet/core/security/data-protection/configuration/default-settings?view=aspnetcore-5.0#key-lifetime