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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T10:28:57+00:00 2026-05-15T10:28:57+00:00

I am trying to save the http_referer so I can send the user back

  • 0

I am trying to save the http_referer so I can send the user back to that url after he has logged in. Right now I have a before_filter in my controllers that sends them to a log in page if a session has not been created via a redirect_to. However when I check the HTTP_REFERER it is nil (whereas ‘REQUEST_URI’ does return where Im originally coming from).

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-15T10:28:59+00:00Added an answer on May 15, 2026 at 10:28 am

    HTTP_REFERER is an HTTP header set by the browser in the request containing the the address of the previous web page from which a link to the currently requested page was followed. It will not be set when directly navigating to a page.

    REQUEST_URI (also available via request.request_uri())is the Uniform Resource Identifier used to access the Rails controller/action and should always be set.

    Throw this debugging code into your view:

    <ul>
    <% request.env.each do |item| %>
        <li><%= item[0] %> : <%= item[1] %></li>
    <% end %>
    </ul>
    

    If HTTP_REFERER is not set, make sure you are navigating to that page via a link or redirect and see if it is set then.

    There is also a chance your browser is not setting the HTTP_REFERER header. Be sure you do not have an add-on affecting this. You can use a nifty Firefox add-on called Tamper Data to see the headers being sent.

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

Sidebar

Related Questions

I'm trying to save my Photo class that has a byte[] File field. When
I'm trying to save some information from a user that is saved on the
I have a JSON return that I'm trying to save into a NSDictionary, However,
I am trying to save a few files that all have the same name.
When trying to save the database using boost serialization, I encounter the segfault that
I have a json file I'm trying to save when btn one is clicked
I have multiple variables in a shell script; i was trying to save some
I have this fiddle: http://jsfiddle.net/y8Uju/5/ I am trying to save the numbers, because, when
I am trying to save a user uploaded file below web root, to prevent
I am trying to save a couple of images that are linked to by

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.