dongqiang4986 2014-05-31 09:43
浏览 50

如何阻止在同一台机器上运行的多个浏览器访问某个网页?

My application requires that only one(first) among multiple browsers running on one PC is able to access a certain web page and the requests from other browsers is blocked/not serviced ? Is there anyway to do this using php ? Is there a way to do it even if I don't restrict myself to php ? I have looked into sessions and cookies but there doesn't seem to be a method to share cookies between browsers(sharing sessions is entirely out of question, I understand). Since private IPs are not known to the server, I can't develop a method to use those either, I'm stuck, any help will be appreciated.

PS: I'm an intern at a firm, and I wasn't told the exact scenario this feature is required for, but this is what is needed to be done. I suggested using client authorization(login id, password) for it, but that suggestion was rejected, I'm stuck !

EDIT: I only create a session if a client with the same IP (flags for ip stored in a DB) is not surfing the page., otherwise if same ip is already in session, they are thrown out... It isn't really an exercise, they want a working solution !. I get the IP by $_SERVER['REMOTE_ADDR'] and $_SERVER['HTTP_X_FORWARDED_FOR'] - It blocks the global IPs which I don't really want.

EDIT 2 : How about using a java applet or flash cookies(in a roundabout way somehow) to do this ?

  • 写回答

2条回答 默认 最新

  • duanqi6274 2014-05-31 09:49
    关注

    That can't be done, at least not in a fool proof way. The different browsers could be using different proxies, so filtering by IP won't be enough even if you could do it. Ask why this needs to be done, and then when you know what actually is required, look for a way to do it.

    评论

报告相同问题?

悬赏问题

  • ¥15 ETLCloud 处理json多层级问题
  • ¥15 matlab中使用gurobi时报错
  • ¥15 这个主板怎么能扩出一两个sata口
  • ¥15 不是,这到底错哪儿了😭
  • ¥15 2020长安杯与连接网探
  • ¥15 关于#matlab#的问题:在模糊控制器中选出线路信息,在simulink中根据线路信息生成速度时间目标曲线(初速度为20m/s,15秒后减为0的速度时间图像)我想问线路信息是什么
  • ¥15 banner广告展示设置多少时间不怎么会消耗用户价值
  • ¥16 mybatis的代理对象无法通过@Autowired装填
  • ¥15 可见光定位matlab仿真
  • ¥15 arduino 四自由度机械臂