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 4105448
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T21:14:53+00:00 2026-05-20T21:14:53+00:00

I use JSP in server side and want to validate that, an user must

  • 0

I use JSP in server side and want to validate that, an user must not log in from two different IP addresses. What is the method to do this validation?

And some says that the client IP address may not be get from the server side because of some proxies involved. Then how the google and facebook are doing this? Will this be reliable in production environmennt? please explain. Thank you !

  • 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-20T21:14:53+00:00Added an answer on May 20, 2026 at 9:14 pm

    Well, getting the IP address is as easy as using ServletRequest#getRemoteAddr()

    But as you’ve noted already, there is no way to get this reliably – if the client is using a proxy, the connection will appear to originate at that IP address. I don’t believe Facebook or Google can get around this either – which is why you can access US only features (for example, Google Voice in Gmail) by logging in via a proxy/ssh tunnel that has a US IP address.

    If you just want to stop a user from logging in from two different IP addresses simultaneously, all you need to do is track what IP address their current session (if one exists) originates from and either

    • stop the second login attempt, or
    • expire the first session

    I’m not sure what value there might be in preventing a login from different IP addresses at different times since that’s very likely going to happen with users who are travelling around or moving from network to network.

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

Sidebar

Related Questions

I want something similar with php/jsp in java, but not on the server side,
Why is it not advisable to use JavaScript in JSP? One rationale that I
I am trying to use JSP on server-side to perform a variable number of
When I send a request from JSP FORM, the server side automatically parses data
I use node.js/ejs on the server side and backbone.js on the client side. Both
I am developing a project with Struts2. I use jsp for web-side. I use
I'm not an expert in Server-side programming nor Java-EE, and I've been looking how
I am new to the JSP and server side programming. Till now I am
I know that I can use the getParameter() to pass client-side objects, but I
enter code hereHiya, so far I didn't use JSP at all and I find

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.