Forms Authentication Redirecting to Login

Discussion in 'ASP .Net' started by Dev guy, Dec 18, 2008.

  1. Dev guy

    Dev guy Guest

    Hi all
    I have a site where we use Forms Authentication. When a user goes to
    pay for something, we redirect them to a Payment Site outside of our
    site (such as PayPal). When the payment is successful, the user gets
    redirected back to our site.

    The problem that we are experiencing is that when the user is
    redirected back to our site from the payment site, the user loses its
    session/cookie and taken to the login page. I am not sure if it was
    the cookie or the session that was timed out. This does not happen
    every time. It happens on occasion.

    Does anyone have any idea what is happening?
    Webconfig has these settings.

    <authentication mode="Forms">
    <forms loginUrl="~/Login.aspx" slidingExpiration="true" />

    There is no entry in Session so I am guessing it is defaulted to 20

    H F
    Dev guy, Dec 18, 2008
    1. Advertisements

  2. When using forms authentication with slidingExpiration set to true,
    the cookie will be updated when more than half the timeout value has
    elapsed (30 min by default). As a result of this, you might be logged
    off sooner than you think. So, set slidingExpiration to false and
    define exact timeout value.
    Alexey Smirnov, Dec 19, 2008
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.