D
D
ds00lon2015-10-22 17:17:18
PHP
ds00lon, 2015-10-22 17:17:18

How to disable access to the PHPSESSION cookie from JavaScript?

All steel cookies do not need to be protected, but this is only necessary.
What may need to be sent to the header?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Aleksey Ratnikov, 2015-10-22
@mahoho

session_set_cookie_params(0, "/", ".{$_SERVER["HTTP_HOST"]}", false, true);
session_start();

Here is the last parameter indicating whether js can read the cookie.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question