http-referer

Redirect to the url of the clicked (referred) link

浪子不回头ぞ 提交于 2019-12-07 15:09:41
I have a scenario where the user receives an email from the system with a specific link which requires login. say for example the link is http://test.url.com/product/2 . Where clicking on this link redirects the user to the sign in page and should redirect to the received url upon success login. But the issue I am having is the system always redirects to the default location which is http://test.url.com/dashboard . To implement this I used http://symfony.com/doc/current/reference/configuration/security.html#redirecting-after-login use_referer: true in security.yml and to test it I have used

Redirects and Referers

ε祈祈猫儿з 提交于 2019-12-07 14:32:55
问题 My actual implementation of this is much more complicated, with authentication and a bunch of other stuff, but at the simplest form, here's the problem I'm having. Redirecting with header doesn't reveal itself as a referer. So, let's say I have three pages: start.php, middle.php and end.php start.php <html><body> <a href="middle.php">middle</a> </body></html> middle.php <?php header('Location: end.php'); ?> end.php <?php echo 'The referer is: ' . $_SERVER['HTTP_REFERER']; ?> When you follow

Using cURL to download a site's HTML source, but getting different file than intended

荒凉一梦 提交于 2019-12-07 07:56:44
问题 I'm trying to use cURL and PHP to download the HTML source (as it appears in the browser) of here. But instead of the actual source code, this is returned instead (a meta refresh link set to 0). <html> <head><title>Object moved</title></head> <body> <h2>Object moved to <a href="https://login.live.com/login.srf?wa=wsignin1.0&rpsnv=11&checkda=1&ct=1321044850&rver=6.1.6195.0&wp=MBI&wreply=http:%2F%2Fwww.windowsphone.com%2Fen-US%2Fapps%2Fea39f002-ac30-e011-854c-00237de2db9e&lc=1033&id=268289"

Changing the value of referrer [duplicate]

一世执手 提交于 2019-12-07 03:09:48
问题 This question already has answers here : Closed 6 years ago . Possible Duplicate: How to manually set REFERER header in Javascript? How to change the value of document.referrer ? I tried this <body> <center><a href="test.php" target="_self">self</a></center> <script type="text/javascript"> alert( document.referrer); document.referrer="test"; alert( document.referrer); </script> </body> It is not working, any ideas? 回答1: You can't modify the referrer directly, but you can use history.pushState

HTTP Referer on HTML Frames

我的梦境 提交于 2019-12-06 15:46:17
Say that I have a link from one.com to two.com/A.html. A.html looks like this <FRAMESET cols="100%"> <FRAME src="B.html"> </FRAMESET> The HTTP Referer on A.html is "one.com", but what will the HTTP referer be on B.html? Is this browser specific? it'll be two.com/A.html, the link from the container. It's not browser specific, unless the browser is told to send a different referer via configuration It should be two.com/a.html (i.e. the page that has the frameset on it). Remember that these referrers are set by the browser and therefore can be faked. 来源: https://stackoverflow.com/questions

PHP redirect back to previous page

懵懂的女人 提交于 2019-12-06 07:32:57
问题 What I have done for the login.php page is if a user has logged in, he will be redirected to first.php page. session_start(); if(isset($_SESSION['usr']) && isset($_SESSION['pswd'])){ header("Location: first.php"); } In all other pages, if user hasn't logged in he will be redirected to login.php page. session_start(); if(!isset($_SESSION['usr']) || !isset($_SESSION['pswd'])){ header("Location: login.php"); } Here is the problem: is there a way to redirect the user back to where he was from?

HTTP Referer header in Struts 2

余生颓废 提交于 2019-12-06 06:15:57
问题 How can I get the Referer header under Struts2? Right now I'm using an ActionSupport class and I can't seem to get a ServletActionContext object or implement the ServletRequestAware interface? (Where is ServletRequestAware in Struts2? which jar?) I'm trying to set up an automatic redirect to a page's referer, stored in a session variable. When someone requests OAuth authentication, I store the referer in session and then send them to twitter. When they click allow, twitter sends them to my

Redirects and Referers

这一生的挚爱 提交于 2019-12-05 23:53:04
My actual implementation of this is much more complicated, with authentication and a bunch of other stuff, but at the simplest form, here's the problem I'm having. Redirecting with header doesn't reveal itself as a referer. So, let's say I have three pages: start.php, middle.php and end.php start.php <html><body> <a href="middle.php">middle</a> </body></html> middle.php <?php header('Location: end.php'); ?> end.php <?php echo 'The referer is: ' . $_SERVER['HTTP_REFERER']; ?> When you follow the link, you end up at end.php, but the referer is not middle.php. Is there any other redirection

How to set the Referer header before loading a page with Ruby mechanize?

半世苍凉 提交于 2019-12-05 19:40:18
Is there a straightforward way to set custom headers with Mechanize 2.3? I tried a former solution but get: $agent = Mechanize.new $agent.pre_connect_hooks << lambda { |p| p[:request]['Referer'] = 'https://wwws.mysite.com/cgi-bin/apps/Main' } # ./mech.rb:30:in `<main>': undefined method `pre_connect_hooks' for nil:NilClass (NoMethodError) The docs say: get(uri, parameters = [], referer = nil, headers = {}) { |page| ... } so for example: agent.get 'http://www.google.com/', [], agent.page.uri, {'foo' => 'bar'} alternatively you might like: agent.request_headers = {'foo' => 'bar'} agent.get url

Can $_SERVER['SERVER_NAME'] be forged/faked?

↘锁芯ラ 提交于 2019-12-05 10:54:04
Can the PHP variable $_SERVER['SERVER_NAME'] be forged or faked? I was planning on using that as a security measure for form posting. I would check to make sure that variable is my site name (www.example.com). I know HTTP_REFERRER can be faked, but I wasn't sure on this one. Thanks! Actually $_SERVER['SERVER_NAME'] can be affected by what the client browser sends over... See http://shiflett.org/blog/2006/mar/server-name-versus-http-host for a through investigation on the issue. By a visitor it can't normally be faked out. But I suspect you would want to enforce a certain SERVER_NAME to license