locked
WCF Services and ASP.Net session expiration RRS feed

  • Question

  • Hello,

    I've tried googling around and fixit it by myself but I got no luck... I've got a Silverlight 4 application that lives inside the browser and uses the Asp.net AuthenticationService to authenticate the users to the WCF Services...

    The login phase is done this way :

      private void LoginButton_Click(object sender, EventArgs e)
        {
          tbMessaggioErrore.Visibility = System.Windows.Visibility.Collapsed;
          client.LoginCompleted += new EventHandler<DO.ServiceAuthentication.LoginCompletedEventArgs>(client_LoginCompleted);
    
          this.PromptResult = tbUserName.Text;
          bool rememberMe = (cbRememberMe.IsChecked.HasValue && cbRememberMe.IsChecked.Value);
          client.LoginAsync(tbUserName.Text, tbPassword.Password, string.Empty, rememberMe);
        }

    and in the WCF Service I do so  (for each service that's needs to be authenticated):

     public List<Items> GetData(int UserID)
        {
          if (!HttpContext.Current.User.Identity.IsAuthenticated) throw new SecurityExeption();
    ...
    }

    Our customers need the silverlight session to live for 5 hours but right now we got disconnection problems after 2/3 apparently randomly... I've set in IIs the Timeout to 300 in the Proxy I generates the Timespan but nothing.... it continues to disconnect after some time, I've checked and also tried to disable AppPool recycle.... any suggestion?

    Thanks

    Paolo

     

     

     

     

     

    Friday, December 17, 2010 1:50 PM

All replies

  • On 12/17/2010 8:50 AM, Ponzano Paolo wrote:
    > Hello,
    >
    > I've tried googling around and fixit it by myself but I got no luck...
    > I've got a Silverlight 4 application that lives inside the browser and
    > uses the Asp.net AuthenticationService to authenticate the users to the
    > WCF Services...
    >
    > The login phase is done this way :
    >
    > private void LoginButton_Click(object sender, EventArgs e)
    > {
    > tbMessaggioErrore.Visibility = System.Windows.Visibility.Collapsed;
    > client.LoginCompleted+= new EventHandler<DO.ServiceAuthentication.LoginCompletedEventArgs>(client_LoginCompleted);
    >
    > this.PromptResult = tbUserName.Text;
    > bool rememberMe = (cbRememberMe.IsChecked.HasValue&& cbRememberMe.IsChecked.Value);
    > client.LoginAsync(tbUserName.Text, tbPassword.Password, string.Empty, rememberMe);
    > }
    >
    > and in the WCF Service I do so (for each service that's needs to be
    > authenticated):
    >
    > public List<Items> GetData(int UserID)
    > {
    > if (!HttpContext.Current.User.Identity.IsAuthenticated) throw new SecurityExeption();
    > ..
    > }
    >
    > Our customers need the silverlight session to live for 5 hours but right
    > now we got disconnection problems after 2/3 apparently randomly... I've
    > set in IIs the Timeout to 300 in the Proxy I generates the Timespan but
    > nothing.... it continues to disconnect after some time, I've checked and
    > also tried to disable AppPool recycle.... any suggestion?
    >
     
    I had an application that was ASP.NET and WCF service. The user was to
    be able to retrieve the last session, even if the session was lost due
    to IIS resets or normal session timeouts. And they could comeback 1,000
    later if they wanted, log back into the system and take off as if
    nothing had happened. It involved keeping a user's session data in an
    object that was sent to the database table and was retrievable by unique
    client, once it was detected the the object was no longer in session for
    the client -- get it and put it back into session.
     
     
    Sunday, December 19, 2010 3:15 AM