0

When I add this in .htaccess

php_value session.cookie_secure 1

the $_SESSION['online'] = session_id() was changed every page refresh?

2
  • can you include a little more of your code?
    – John Smith
    May 30, 2015 at 2:25
  • <?php session_start(); if(!isset($_SESSION['online'])) $_SESSION['online'] = session_id(); ?> It works good. But when add php_value session.cookie_secure 1 to .htaccess, it not working. May 30, 2015 at 2:27

1 Answer 1

1

session.cookie_secure specifies that the session cookie can only be sent over a secure connection, i.e. HTTPS:

session.cookie_secure specifies whether cookies should only be sent over secure connections.

That means, if you are not using HTTPS, your session won't work.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.