Professional Web Applications Themes

How to find out time on site ?? - ASP.NET General

Steve, Session_End fires on a background thread. Therefore, it may not fire exactly when the timeout value is reached. If you want to track how long someone's been on your site, you will have to pass that information between requests. The problem is that you won't be able to track how long the user was on the last page on your site because there will be no final figure to take into account. Therefore, I think trying to do this is futile. As for writing your own thread to do this, you can certainly do it. I would make sure ...

  1. #1

    Default RE: How to find out time on site ??

    Steve,

    Session_End fires on a background thread. Therefore, it may not fire
    exactly when the timeout value is reached.

    If you want to track how long someone's been on your site, you will have to
    pass that information between requests. The problem is that you won't be
    able to track how long the user was on the last page on your site because
    there will be no final figure to take into account. Therefore, I think
    trying to do this is futile.

    As for writing your own thread to do this, you can certainly do it. I
    would make sure to use the IsClientConnected method to ensure that you
    don't kill any sessions that you shouldn't kill.

    Jim Cheshire
    Developer Support
    ASP.NET
    [email]jamescheonline.microsoft.com[/email]

    This post is provided as-is with no warranties and confers no rights.

    --------------------
    >From: "Steve M" <stevenospam.com>
    >Newsgroups: microsoft.public.dotnet.framework.aspnet
    >Subject: How to find out time on site ??
    >Lines: 15
    >X-Priority: 3
    >X-MSMail-Priority: Normal
    >X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
    >X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
    >Message-ID: <3WsWa.65511$6a3.1632962twister.rdc-kc.rr.com>
    >Date: Fri, 1 Aug 2003 07:23:18 -0500
    >NNTP-Posting-Host: 65.28.105.11
    >X-Complaints-To: [email]abuserr.com[/email]
    >X-Trace: twister.rdc-kc.rr.com 1059740415 65.28.105.11 (Fri, 01 Aug 2003
    07:20:15 CDT)
    >NNTP-Posting-Date: Fri, 01 Aug 2003 07:20:15 CDT
    >Path:
    cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!newsfeed 00.sul.t-online.de!newsfee
    d01.sul.t-online.de!t-online.de!newspeer1-gui.server.ntli.net!ntli.net!peer0
    1.cox.net!peer02.cox.net!cox.net!news-server.columbus.rr.com!cyclone2.kc.rr.
    com!news2.kc.rr.com!twister.rdc-kc.rr.com.POSTED!53ab2750!not-for-mail
    >Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.framework.aspnet:164102
    >X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
    >
    >I would like to track how long a user spends on my site.
    >I normally would do that in Session_End -- however, it is firing way later
    >than the Timeout value.
    >First, does anyone know why that might happen.
    >Second, how can I find out how much tmie has passed since the user last
    made
    >a request (other than me doing it myself with every request?)
    >And also, does anyone think there would be a problem if I have my own
    thread
    >that abandons the session after a certain amount of time -- since I cannot
    >rely on Session_End for, some reason, firing at the appropriate time?
    >Really, what I'd like to know is why Session_End is not firing in a timely
    >manner -- even when the server is not especially busy, the sessions end
    >maybe, on average 40 minutes LATER than the timeout value.
    >Thanks in advance.
    >
    >
    >
    Jim Cheshire [MSFT] Guest

  2. #2

    Default Re: How to find out time on site ??

    Jim,

    Thanks for the help.
    You mentioned that Session_End fires on a background thread, so it may not
    fire exactly when the timeout is reached. Do you know a possibly reason why
    mine is firing WAY after that timeout value is reached?
    Is there anything in particular that I might be doing with Session state
    datd, or anythign else, that could possibly cause this strange behavior?


    "Jim Cheshire [MSFT]" <jamescheonline.microsoft.com> wrote in message
    news:UGHUd5DWDHA.2000cpmsftngxa06.phx.gbl...
    > Steve,
    >
    > Session_End fires on a background thread. Therefore, it may not fire
    > exactly when the timeout value is reached.
    >
    > If you want to track how long someone's been on your site, you will have
    to
    > pass that information between requests. The problem is that you won't be
    > able to track how long the user was on the last page on your site because
    > there will be no final figure to take into account. Therefore, I think
    > trying to do this is futile.
    >
    > As for writing your own thread to do this, you can certainly do it. I
    > would make sure to use the IsClientConnected method to ensure that you
    > don't kill any sessions that you shouldn't kill.
    >
    > Jim Cheshire
    > Developer Support
    > ASP.NET
    > [email]jamescheonline.microsoft.com[/email]
    >
    > This post is provided as-is with no warranties and confers no rights.
    >
    > --------------------
    > >From: "Steve M" <stevenospam.com>
    > >Newsgroups: microsoft.public.dotnet.framework.aspnet
    > >Subject: How to find out time on site ??
    > >Lines: 15
    > >X-Priority: 3
    > >X-MSMail-Priority: Normal
    > >X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
    > >X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
    > >Message-ID: <3WsWa.65511$6a3.1632962twister.rdc-kc.rr.com>
    > >Date: Fri, 1 Aug 2003 07:23:18 -0500
    > >NNTP-Posting-Host: 65.28.105.11
    > >X-Complaints-To: [email]abuserr.com[/email]
    > >X-Trace: twister.rdc-kc.rr.com 1059740415 65.28.105.11 (Fri, 01 Aug 2003
    > 07:20:15 CDT)
    > >NNTP-Posting-Date: Fri, 01 Aug 2003 07:20:15 CDT
    > >Path:
    >
    cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!newsfeed 00.sul.t-online.de!newsfee
    >
    d01.sul.t-online.de!t-online.de!newspeer1-gui.server.ntli.net!ntli.net!peer0
    >
    1.cox.net!peer02.cox.net!cox.net!news-server.columbus.rr.com!cyclone2.kc.rr.
    > com!news2.kc.rr.com!twister.rdc-kc.rr.com.POSTED!53ab2750!not-for-mail
    > >Xref: cpmsftngxa06.phx.gbl
    microsoft.public.dotnet.framework.aspnet:164102
    > >X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
    > >
    > >I would like to track how long a user spends on my site.
    > >I normally would do that in Session_End -- however, it is firing way
    later
    > >than the Timeout value.
    > >First, does anyone know why that might happen.
    > >Second, how can I find out how much tmie has passed since the user last
    > made
    > >a request (other than me doing it myself with every request?)
    > >And also, does anyone think there would be a problem if I have my own
    > thread
    > >that abandons the session after a certain amount of time -- since I
    cannot
    > >rely on Session_End for, some reason, firing at the appropriate time?
    > >Really, what I'd like to know is why Session_End is not firing in a
    timely
    > >manner -- even when the server is not especially busy, the sessions end
    > >maybe, on average 40 minutes LATER than the timeout value.
    > >Thanks in advance.
    > >
    > >
    > >
    >

    Steve M Guest

  3. #3

    Default Re: How to find out time on site ??

    Steve,

    I'm not sure. Have you done some logging to determine what's going on?
    Could there be some pending requests on the request table for this session?
    Could be any number of things.

    If you continue to have a problem with that and really want to track it
    down, you should open a case with us to see if we can help.

    Jim Cheshire
    Developer Support
    ASP.NET
    [email]jamescheonline.microsoft.com[/email]

    This post is provided as-is with no warranties and confers no rights.

    --------------------
    >From: "Steve M" <stevenospam.com>
    >Newsgroups: microsoft.public.dotnet.framework.aspnet
    >References: <3WsWa.65511$6a3.1632962twister.rdc-kc.rr.com>
    <UGHUd5DWDHA.2000cpmsftngxa06.phx.gbl>
    >Subject: Re: How to find out time on site ??
    >Lines: 87
    >X-Priority: 3
    >X-MSMail-Priority: Normal
    >X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
    >X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
    >Message-ID: <JXAWa.56139$o27.1200989twister.rdc-kc.rr.com>
    >Date: Fri, 01 Aug 2003 21:28:09 GMT
    >NNTP-Posting-Host: 65.28.105.11
    >X-Complaints-To: [email]abuserr.com[/email]
    >X-Trace: twister.rdc-kc.rr.com 1059773289 65.28.105.11 (Fri, 01 Aug 2003
    16:28:09 CDT)
    >NNTP-Posting-Date: Fri, 01 Aug 2003 16:28:09 CDT
    >Path:
    cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!newsfeed 00.sul.t-online.de!t-onlin
    e.de!diablo.theplanet.net!mephistopheles.news.clar a.net!news.clara.net!ecngs
    !feeder.ecngs.de!peer02.cox.net!cox.net!newsfeed2. easynews.com!newsfeed1.eas
    ynews.com!easynews.com!easynews!elnk-pas-nf1!newsfeed.earthlink.net!cyclone.
    socal.rr.com!cyclone2.kc.rr.com!news2.kc.rr.com!tw ister.rdc-kc.rr.com.POSTED
    !53ab2750!not-for-mail
    >Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.framework.aspnet:164258
    >X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
    >
    >Jim,
    >
    >Thanks for the help.
    >You mentioned that Session_End fires on a background thread, so it may not
    >fire exactly when the timeout is reached. Do you know a possibly reason why
    >mine is firing WAY after that timeout value is reached?
    >Is there anything in particular that I might be doing with Session state
    >datd, or anythign else, that could possibly cause this strange behavior?
    >
    >
    >"Jim Cheshire [MSFT]" <jamescheonline.microsoft.com> wrote in message
    >news:UGHUd5DWDHA.2000cpmsftngxa06.phx.gbl...
    >> Steve,
    >>
    >> Session_End fires on a background thread. Therefore, it may not fire
    >> exactly when the timeout value is reached.
    >>
    >> If you want to track how long someone's been on your site, you will have
    >to
    >> pass that information between requests. The problem is that you won't be
    >> able to track how long the user was on the last page on your site because
    >> there will be no final figure to take into account. Therefore, I think
    >> trying to do this is futile.
    >>
    >> As for writing your own thread to do this, you can certainly do it. I
    >> would make sure to use the IsClientConnected method to ensure that you
    >> don't kill any sessions that you shouldn't kill.
    >>
    >> Jim Cheshire
    >> Developer Support
    >> ASP.NET
    >> [email]jamescheonline.microsoft.com[/email]
    >>
    >> This post is provided as-is with no warranties and confers no rights.
    >>
    >> --------------------
    >> >From: "Steve M" <stevenospam.com>
    >> >Newsgroups: microsoft.public.dotnet.framework.aspnet
    >> >Subject: How to find out time on site ??
    >> >Lines: 15
    >> >X-Priority: 3
    >> >X-MSMail-Priority: Normal
    >> >X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
    >> >X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
    >> >Message-ID: <3WsWa.65511$6a3.1632962twister.rdc-kc.rr.com>
    >> >Date: Fri, 1 Aug 2003 07:23:18 -0500
    >> >NNTP-Posting-Host: 65.28.105.11
    >> >X-Complaints-To: [email]abuserr.com[/email]
    >> >X-Trace: twister.rdc-kc.rr.com 1059740415 65.28.105.11 (Fri, 01 Aug 2003
    >> 07:20:15 CDT)
    >> >NNTP-Posting-Date: Fri, 01 Aug 2003 07:20:15 CDT
    >> >Path:
    >>
    >cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!newsfee d00.sul.t-online.de!newsfe
    e
    >>
    >d01.sul.t-online.de!t-online.de!newspeer1-gui.server.ntli.net!ntli.net!peer
    0
    >>
    >1.cox.net!peer02.cox.net!cox.net!news-server.columbus.rr.com!cyclone2.kc.rr
    Jim Cheshire [MSFT] Guest

Similar Threads

  1. swarren.net i can't find anything on that site
    By alsilk in forum ASP.NET Building Controls
    Replies: 1
    Last Post: October 23rd, 01:19 AM
  2. Find component in ASP.NET form at run-time
    By Sean Winstead in forum ASP.NET Building Controls
    Replies: 2
    Last Post: September 30th, 01:36 PM
  3. Find time consuming SQL statements
    By Arthur Groen in forum Informix
    Replies: 0
    Last Post: August 1st, 07:31 AM
  4. Speed up Find operation across entire site?
    By James Robertson - Learning Media in forum Macromedia Dreamweaver
    Replies: 0
    Last Post: July 17th, 12:41 AM
  5. IE cannot find internet site to download BLOB
    By Roger Withnell in forum ASP
    Replies: 10
    Last Post: July 13th, 07:59 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139