Capture IP only once per visit

Discussion in 'ASP .Net' started by Mort Strom, Mar 30, 2009.

  1. Mort Strom

    Mort Strom Guest

    My default.aspx page captures client IP and browser values for all users,
    then records to a SQL table. I'm finding that there may be several records
    inserted per visit because I see 2~3 entries within a minute or so. The
    default.aspx page has no post-back or AJAX calls.

    How do I ensure that client IP is captured only once per session?
     
    Mort Strom, Mar 30, 2009
    #1
    1. Advertising

  2. re:
    !> How do I ensure that client IP is captured only once per session?

    Set a session variable ( Session("IP") ).

    Then check whether the session variable has been set or not.

    If it has been set, don't do the client IP capture.
    If it hasn't been set, do the client IP capture.





    Juan T. Llibre, asp.net MVP
    asp.net faq : http://asp.net.do/faq/
    =========================
    "Mort Strom" <> wrote in message news:D...
    >
    > My default.aspx page captures client IP and browser values for all users, then records to a SQL table. I'm finding
    > that there may be several records inserted per visit because I see 2~3 entries within a minute or so. The
    > default.aspx page has no post-back or AJAX calls.
    >
    > How do I ensure that client IP is captured only once per session?
     
    Juan T. Llibre, Mar 30, 2009
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Scott Townsend
    Replies:
    2
    Views:
    4,438
  2. =?Utf-8?B?S01aX3N0YXRl?=

    Quick one - Is SESSION per browser instance or per IP Address?

    =?Utf-8?B?S01aX3N0YXRl?=, Apr 4, 2006, in forum: ASP .Net
    Replies:
    7
    Views:
    5,945
    gerry
    Apr 10, 2006
  3. Razvan
    Replies:
    1
    Views:
    438
    tony vee
    Sep 10, 2004
  4. gnewsgroup
    Replies:
    1
    Views:
    788
    bruce barker
    Dec 20, 2007
  5. Tom Ketter
    Replies:
    2
    Views:
    140
    Chris Mohan
    Nov 12, 2004
Loading...

Share This Page