0

Is it possible to save user identifying data in a cookie, so if the user changes browsers on a login-required page, then you could pick up the user identifying information and use it to make the transition unnoticeable, rather than having to prompt the user to log in again?

I have noticed a lot of sites develop this way, I would like to avoid this on my projects, if at all possible.

Edit

What I mean by 'changing browsers' is from chrome to firefox, or firefox to ie.

I appreciate any advice.

Thanks in advance!

AnchovyLegend
  • 12,139
  • 38
  • 147
  • 231
  • 1
    You have examples of sites which accomplish this _cross-browser_? If so, I can only imagine it is done with things like Google & Facebook logins likely to be present on both browsers. Setting your own cookie for that definitely will be out of the question. – Michael Berkowski Jan 04 '14 at 00:48
  • 3
    It would be a pretty serious privacy problem if this were possible. – Pekka Jan 04 '14 at 00:48
  • Do you perhaps mean cross browser-_windows_? I don't think this is possible going from, say, Chrome to Firefox. – Jordan Jan 04 '14 at 00:50
  • @Jordan: Sessions will do just fine for that, no need for cookies (with the sessioncookie excluded) – Martijn Jan 04 '14 at 00:52
  • @Martijn Yeah, I know, but I am not sure if the OP is aware. I have never seen a true cross-browser way to do as he describes, so I am wondering if he is perhaps mistaken. – Jordan Jan 04 '14 at 01:03
  • @Jordan, Mistaken about what? Perhaps you misunderstood the question, please see edited. – AnchovyLegend Jan 04 '14 at 04:45

2 Answers2

2

you can use a flash cookie.. if its relevant for your solution.

How do I uniquely identify computers visiting my web site?

Community
  • 1
  • 1
shaish
  • 1,479
  • 1
  • 12
  • 23
1

Cookies are specific to only one browser, to accomplish this task, what you really have to do is track the IP address of the person, and store the IP address in your server instead of the browser, so when the person changes the browser, you can see, that the IP is same and return the same content.

This is something of the kind i was talking about:

<?php
    // First time visit
    $file = fopen("servercookies.txt","w");
    fwrite($file, $_SERVER['REMOTE_ADDR']." user123223 ".$preferences);
    fclose($file);
?>

I know that $preferences doesn't exist, its just to show you how you might go about doing it..

Anshu Dwibhashi
  • 4,617
  • 3
  • 28
  • 59