Open Closed

Language switch feature not working on server hosted by IIS #3225


0
[email protected] created
  • ABP Framework version: v5.1.2
  • UI type: Angular and MVC
  • DB provider: EF Core
  • Tiered (MVC) or Identity Server Separated (Angular): yes
  • Exception message and stack trace:
  • Steps to reproduce the issue:"
  • Log in
  • When on the Home page or any other page, try to switch the language -> some elements are updated in the target language but most don't

As you can see in the screen shot, there are 2 cookies .AspNetCore.Culture : one with path /CentralTools/Dev/masterdata and another with path /

After login, both of them have the same value, for example French.

When I change the language to English, only the one with the /CentralTools/Dev/masterdata path gets updated.

If I delete the other one (with path /) then everything works well ; I can change language any time, it is ok. But obviously we are not going to ask users to delete manually the cookie each time they log in...

What would you suggest to address this issue ?

Thanks,

Thomas

PS : This issue doe not happen locally or if the website is deployed at the root with IIS.


9 Answer(s)
  • 0
    gterdem created
    Support Team

    Can you try it in incognito mode? Also, can you share your domain names?

    The culture (with / path) can be already set by other domain before you navigate to sub-domain.

  • 0
    [email protected] created

    I have tried in incognito mode, no luck, same behavior.

    You woud not have access to our integration server for security reasons ; I have tried from home, it does not work.

    The culture (with / path) can be already set by other domain before you navigate to sub-domain.

    This is probably true. The cookie with path '/' is set up at login. The cookie with the path /Centraltools/masterdata is set up at login and updated when I use the switch language feature.

    Still I have no clue on how to advance from here. I was thinking maybe, I have to override the switch language cookie creation mechanism or on the contrary block the creation of the cookie with root '/'.

    Any suggestion is welcome.

    Thanks

    Thomas

  • 0
    albert created
    Support Team

    thank you I assigned your issue to @gterdem. he'll help you on that.

  • 0
    [email protected] created

    We can do a Teams or TeamViewer session if that helps. Just send me an email.

    Thanks

  • 0
    albert created
    Support Team

    this doesn't seem to be a framework or ABP commercial template issue. it's related to IIS that's why better to ask on the IIS support website. On the other hand, you can try to change the cookie path in your module class.

    services.ConfigureApplicationCookie(options =>
      {
        options.Cookie.Path = "/";
      });
    
  • 0
    [email protected] created

    Hello Albert,

    Thank you for the answer. I'll test it asap.

    Thomas

  • 0
    albert created
    Support Team

    ok. you can inform us about the recent status.

  • 0
    [email protected] created

    Hello Albert,

    I am sorry but I could not test as we have a blocking issue with the build since thursday . I will test what you have suggested as soon as I can.

    Thomas

  • 0
    albert created
    Support Team

    then I'm closing the issue. you can always reopen