0

I save authentication information in PHP Session variables. Works as it should anywhere - except on Samsung Internet on my Galaxy S8.

Found out that var_dump($_SESSION); is completely empty at subsequent calls, both Jquery ajax and javascript fetch. But only on my phone: works as it should on a Galaxy Note 8.

Edit 1:
echo "<script>alert('session_id: ".session_id()."') ; </script>"; Added this at both the main page and the called page. On my s8 they were different.

Edit 2:
It was probably a bug in Samsung Internet 8 (8.2.01.2). Upgraded to latest and the issue is gone. Note that fetch is supported since 4.0

Ilan
  • 23
  • 5

2 Answers2

0

Do you have cookie support enabled or are they turned off in Samsung Internet Browser?

If they are turned off. you could always use URL session ids... learn more here

Also, check out this reply to a related question. There are some security concerns with using Session Ids in URLs, but they are supported out of the box by PHP.


Another option, would be to employ some Javascript to check for a cookie, from your server... and if not found, notify the user that your site requires the use of cookies, to function properly


That is, if it's a cookie issue.

rexfordkelly
  • 1,623
  • 10
  • 15
  • Thank you for your reply. I do not need to pass session IDs, just used it to debug. My code fills a `
    ` with a `fetch` call. Some of the information passed from the main page to the called file, should never leave the server. This information is passed as session variables. That works as intended as long as the process is contained within the same session. At *Samsung Internet* on my S8 the pages has different sessions. No problem with Firefox on my phone - and no problem with *Samsung Internet* on Galaxy Note 8.
    – Ilan Dec 12 '21 at 09:59
0

It was probably a bug in Samsung Internet 8 (8.2.01.2). Upgraded to latest and the issue is gone. Note that fetch is supported since 4.0.

Ilan
  • 23
  • 5