locked
What is wrong with my application's state management? RRS feed

  • Question

  • User-609535877 posted

    I have one intranet project updated from default OWIN Identity "Individual User Account" template integrated with  OWIN Mixed Authentication library so the application user within our domain can automatically login by his/her AD account without Log on page.

    By now I configured the StateServer to keep server session data in case application pool recycle on the web testing server which hosts several web sites by

    <sessionState mode="StateServer" stateConnectionString="tcpip=127.0.0.1:42424" cookieless="false"/>

    in the application WebConfig.

    On the web server I do following tasks:

    1. Start ASP.NET State Service
    2. On my application, select State Server as Session State and Apply all default setting (Connection string: tcpip=loopback:42424; time-out 10 second)

    The current issue is if I keep web running and then after application pool recycle, it looks like application cookie can't communicate with State Server (maybe session data is lost). At this moment if I click one web link and get a blank page without any exception error. 

    Tuesday, April 2, 2019 2:05 PM

Answers

  • User475983607 posted

    zhao790

    Thank you mgebhard.

    I followed the link you mentioned to generate machine key for the application but I got System.Configuration.ConfigurationErrorsException -- Decryption key specified has invalid hex characters when starting to run.

    How to fix it?

    Sounds like you make a mistake creating the machine key.  

    At the bottom of the article there are several machine key generators.

    <machineKey 
    validationKey='3AF35F121CEA5692E6419967388C33D6C2B492717D5F13F73CBB462A569BB35B3871694DA4EF11B043900B67E14767D7393AC98BB85EC5E1D1E096F8074CE181'
    decryptionKey='10291C0F80186BDC7D8B77F31DA83BA65356D705ACFBD706'
    validation='SHA1'/>

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, April 2, 2019 8:03 PM

All replies

  • User753101303 posted

    Hi,

    Knowing which exception you have would likely help.

    Tuesday, April 2, 2019 2:24 PM
  • User-609535877 posted

    Thank you for your response.

    Sorry for my typo. I didn't catch any exception.

    Tuesday, April 2, 2019 2:33 PM
  • User475983607 posted

    Try setting a static machine key in the web.config.

    https://docs.orchardproject.net/en/latest/Documentation/Setting-up-a-machine-key/

    Also review your exception handling code as it seems the code is not catching exceptions.

    Tuesday, April 2, 2019 2:50 PM
  • User-609535877 posted

    Thank you mgebhard.

    I followed the link you mentioned to generate machine key for the application but I got System.Configuration.ConfigurationErrorsException -- Decryption key specified has invalid hex characters when starting to run.

    How to fix it?

    Tuesday, April 2, 2019 7:31 PM
  • User475983607 posted

    zhao790

    Thank you mgebhard.

    I followed the link you mentioned to generate machine key for the application but I got System.Configuration.ConfigurationErrorsException -- Decryption key specified has invalid hex characters when starting to run.

    How to fix it?

    Sounds like you make a mistake creating the machine key.  

    At the bottom of the article there are several machine key generators.

    <machineKey 
    validationKey='3AF35F121CEA5692E6419967388C33D6C2B492717D5F13F73CBB462A569BB35B3871694DA4EF11B043900B67E14767D7393AC98BB85EC5E1D1E096F8074CE181'
    decryptionKey='10291C0F80186BDC7D8B77F31DA83BA65356D705ACFBD706'
    validation='SHA1'/>

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, April 2, 2019 8:03 PM
  • User-609535877 posted

    After I add machine key to webconfig, now it works. Thanks a lot!

    Wednesday, April 10, 2019 11:54 AM