W
W
weranda2018-08-18 22:38:09
PHP
weranda, 2018-08-18 22:38:09

Is it possible purely in PHP to find out if cookies are enabled without reloading the page?

Hi
Chet I don't get it.
Situation: a person opened the site page for the first time. Is there any way to know if his browser supports cookies without reloading the page and JS/Ajax? If possible, please provide an example.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
X
xmoonlight, 2018-08-18
@weranda

It is forbidden.
You can only get the passed headers by the browser.
But it won't mean anything.

A
Alexander, 2018-08-18
Madzhugin @Suntechnic

You can try to prevent him from opening the page for the first time. Those. if there are no cookies at all - issue an empty page setting cookies with a refresh.
But in this case, a person with disabled cookies will not see your site at all, but will receive an eternal redirect.

S
SagePtr, 2018-08-19
@SagePtr

You can cheat with session.use_trans_sid , but this is such a solution and the page address will look disgusting

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question