Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5956785
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T18:18:26+00:00 2026-05-22T18:18:26+00:00

Is there any way, preferable in java, to uniquely identify a user? I have

  • 0

Is there any way, preferable in java, to uniquely identify a user?

I have the following scenario: I own 10 websites and i want to know when the same user accesses any of my websites. So if a user accesses site A, and after that he accesses site B i want to get a response to the question : Did this particular user accessed site A before?

Keeping track of the IP is a poor approach as mostly IPs are dynamic or more people share the same ip through a router.

I’m guessing that getting the MAC Address is a security branch :).

Cookies are available only for a specific url !?

Is there any way i can get this working?

EDIT:

I read that’s not possbile to access the same cookie across multiple domains. Is it possbile after all ? Here’s the reference : at: Cookie problems with IE and Chrome (working with java) “Cookies are domain based. Many browsers reject cookies on embedded resources (CSS/JS/images) which are served from other domain than the page is been served from”

So if i add a response.addCookie(UniqueCookieForCurrentUser); will it be available on other domains ?

I’m calling, as you suggested, from javascript :

    var query = '?requestURI=' + encodeURIComponent(requestURI)
         + '&resolution=' + encodeURIComponent(resolution)
         + '&websiteid=' + encodeURIComponent(id)
         + '&DisplayedBanners=' + encodeURIComponent(DisplayedBanners);
    document.getElementById("body").innerHTML = "<img src ='http://dan-vaio:8080/licenta/bannerimg.gif" + query + "' width = 728 height = 90 />";

And in servlet i return this: (after adding the cookie to the response)

    File f = new File(filePath);
byte[] b = new byte[(int)f.length()];
FileInputStream fis = new FileInputStream(f);
fis.read(b);
ServletOutputStream out  = response.getOutputStream();
out.write(b);
out.close();
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T18:18:26+00:00Added an answer on May 22, 2026 at 6:18 pm

    Do as all ad networks do: You place a small web bug on each site that loads a cookie from ONE of your servers, so that regardless of which site the user goes to, they always get a cookie from the same bug server. Put a unique identifier into each site’s bug so that you’re not dependent on referers to identify the source site for each hit on the bug server.


    following:

    Ok. on each site you’ll have this on each landing page:

    <img src="http://bugs.example.com?src=siteName" width=1 height=1 alt="Track me, please!" />
    

    and replace siteName with something appropriate for each site. e.g. src=siteA, src=siteB, etc…

    When a user comes in to site A, their browser will load this image from your webbug server, and a cookie will be issued to identify the user. A PHP session cookie, or something like the one generated by Apache’s mod_usertrack). The important thing is that the cookie’s value is UNIQUE for each user.

    So now this user has a cookie in their browser, example.com.track=2536t4234235423423. When the user then visits site B, the browser will send this cookie along with the image request to the web bug server, and now your logs will show that cookie 2536t4234235423423 has visited both site A and site B.

    The cookie by itself is useless, it just identifies a user. But in combination with the URL requested from the web bug server, which contains the name of the originating server, you can then see which site any particular cookie (e.g. user) visited.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is there any way, in any language, to hook my program when a user
Is there any way to have something that looks just like a file on
As a beginner programmer, I want to ask is there any way to using
Is there any way to check whether a file is locked without using a
Is there any way to capture the MouseDown even from the .NET 2.0 TextBox
Is there any way to apply an attribute to a model file in ASP.NET
Is there any way to include the SVN repository revision number in the version
Is there any way to use inheritance in database (Specifically in SQL Server 2005)?
Is there any way to force a listview control to treat all clicks as
Is there any way to listen to an Oracle AQ using a Perl process

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.