2

I'm trying to solve a problem similar to the ones in this question and this one, basically tracking a sub-session for users by browser tab. The thing I'm trying to accomplish, though, is finding a way to set a request parameter to send back to the server with each request, whether it's a simple synchronous link click, a form post, or an ajax request. What occurred to me as a hopeful solution would be if I could set something in the html head that would be sent each time, though I haven't seen anything to suggest that it's possible. I'm hoping to find a solution that doesn't require wrapping all server requests in some sort of javascript to include the desired parameter.

We're using Rails on the backend.

Community
  • 1
  • 1
lobati
  • 9,284
  • 5
  • 40
  • 61
  • Try cookies. On every request sent to the server, cookie values once set goes as headers. – Luke P. Issac May 10 '16 at 03:42
  • How do I track cookies per tab? The problem here is that I want to basically have a separate sub-session per tab for users. – lobati May 10 '16 at 03:43

1 Answers1

1

Difficult question to answer without knowing which server side language you are using. Regardless, using php, perl, python, or any other language, you could generate a unique ID and append it as a query string to your links. If you don't want the ugly links, you can:

A. use .htaccess to perform a mod_rewrite to clean up the URL

B. use an additional cookie to track the sub-session

C. use pure javascript, not very reliable depending on the client browser though..

the method used to track depends on what capabilities you have, database, text file, etc.

Again, not much info to go on.

Bryan
  • 100
  • 6