using an application without repeated logins

Discussion in 'ASP.NET / ASP.NET Core' started by jkarafin, Jul 22, 2008.

Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.
  1. Hi.

    My users are having to re-login after 30 minutes of inactivity, even though I
    1) store session information in an SQL database, and
    2) specified my own machinekey.

    Can someone tell me what more do I need to do to avoid the repeated logins?

    Here are relevant parts of my webconfig:

    <authentication mode='Forms'>
    <forms name='.ASPXAUTH' loginUrl='CmiLogin.aspx' />
    </authentication>

    <sessionState
    mode='SQLServer'
    allowCustomSqlDatabase = 'true'
    sqlConnectionString='data Source=sql2k504.discountasp.net;database=SQL2005_83011_fciosession;user id=SQL2005_83011_fciosession_user;password=*****'
    cookieless='false'
    timeout='720'
    />

    <machineKey validationKey='361D2BCE0FD210DC0981E1411B6DF9FEA4D149DE8E3F7CBC3DC83A907FFA232F6095BEE9828EE24E0C4341858EB13F052EBF76C65EAA86F26610FA7F031314A4'
    decryptionKey='6DC367577C6D5D9A103D5DF0BA8F601EA52B2A1F082CC332'
    validation='SHA1'
    />
     
  2. Here's what I did and it seems to keep my users logged in forhours at a time:


    In my login page, I have:


    Dim ticket As New FormsAuthenticationTicket(2, strauthCode, DateTime.Now, DateTime.Now.AddHours(12), chkPersistent.Checked, strauthCode)


    FormsAuthentication.RedirectFromLoginPage(strauthCode, chkPersistent.Checked)
    In my web.config, I have the machine validation key, just like you do but the forms section is different:



    <system.web>


    <authentication mode="Forms">


    <forms name="myApp" loginUrl="Default.aspx" timeout="480" slidingExpiration="true"/>


    </authentication>
     
Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.

Share This Page