Important Notice from AspDotNetStorefront
It is with dismay that we report that we have been forced, through the action of hackers, to shut off write-access to this forum. We are keen to leave the wealth of material available to you for research. We have opened a new forum from which our community of users can seek help, support and advice from us and from each other. To post a new question to our community, please visit: http://forums.vortx.com
Results 1 to 4 of 4

Thread: Customer Login Status

  1. #1
    nizam_adnsf is offline Junior Member
    Join Date
    Oct 2009
    Posts
    8

    Default Customer Login Status

    I'm working on integrating another website with ASPDNSF 8.0 ML.
    Given the CustomerID, how to check whether the Customer is logged in or not ?

    Basically querying on Database is preferred.

    Any other ideas too welcome.

    Thanks,
    Nizam

  2. #2
    esedirect is offline Senior Member
    Join Date
    Feb 2010
    Location
    Norfolk, UK
    Posts
    343

    Default

    A list of ALL live CustomerSessions

    Code:
    SELECT cs.CustomerID, cs.LastActivity, c.email
    FROM CustomerSession AS cs (NOLOCK)
    JOIN Customer AS c (NOLOCK) ON c.CustomerID = cs.CustomerID
    WHERE c.IsRegistered=1
    http://www.esedirect.co.uk
    --------------------------------------------------------------------------
    Using MS 9.2.0.0 with the following customisations:

    Lightbox/Fancybox enlarged images;
    Auto-suggest searchbox;
    Extra product information shown only to our IP Address (such as supplier info, costs, etc.);
    Failed transactions emailed via trigger;
    Custom app to show basket contents when customer online;
    Orders pushed through to accounting systems.

    All the above without source!

  3. #3
    nizam_adnsf is offline Junior Member
    Join Date
    Oct 2009
    Posts
    8

    Default

    Thanks for the right direction.
    The entry in Session table *still exists* though I logged out of the site leaving me in confused state whether customer really loggedout ?

  4. #4
    esedirect is offline Senior Member
    Join Date
    Feb 2010
    Location
    Norfolk, UK
    Posts
    343

    Default

    I think you'll find that most of your customers/users won't actually logout; they'll just move away from your site, by going to another site or closing their browser. I've checked, CustomerSession.LoggedOut doesn't get set on our system, but what does happen is that a CustomerSession is removed after the AppConfig.Name.SessionTimeoutInMinutes inactivity (in our case 60 minutes). This seems to be actioned from CustomerSession.cs.StaticClear() which calls the stored proc aspdnsf_SessionAge which when called without a CustomerID removes all CustomerSessions which are inactive over the timeout period.

    So, you can determine that they've gone, and any left in the CustomerSession table are possibly still around, but check their LastActivity time.
    http://www.esedirect.co.uk
    --------------------------------------------------------------------------
    Using MS 9.2.0.0 with the following customisations:

    Lightbox/Fancybox enlarged images;
    Auto-suggest searchbox;
    Extra product information shown only to our IP Address (such as supplier info, costs, etc.);
    Failed transactions emailed via trigger;
    Custom app to show basket contents when customer online;
    Orders pushed through to accounting systems.

    All the above without source!