O
O
Outsider V.2015-02-14 21:06:47
PHP
Outsider V., 2015-02-14 21:06:47

How to enable httpOnly for session cookies?

On the site, a session is started using session_start(), but session cookies are available to all user applications (the httpOnly flag is not set). How to enable httpOnly for session cookies? There is a session.cookie_httponly directive in php.ini , but of course I don't have access to this file on hosting. How to be?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
K
Konstantin Coocheenin, 2016-07-13
@coocheenin

Given the date of the question, you are most likely not relevant, but so that the question does not hang unanswered.
file Or, at the beginning of each php script, enable cookie_httponly support by running ini_set() :
ini_set('session.cookie_httponly', 1);

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question