B
B
banny_name2015-10-03 22:17:18
PHP
banny_name, 2015-10-03 22:17:18

How to work with php sessions, setting preferences, etc?

How to correctly set session lifetime?
1. session_set_cookie_params(1080,[etc]);
or
2. ini_set('session.gc_maxlifetime', 10800);
?
Also, how to disable access to sessions?
I store sessions in the site directory, how can I disable access to them?
So that no one / nothing but the application can read them, etc.
and how to secure the work with sessions?
There is a chance to change the session ID, etc.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
riente, 2015-10-03
@riente

There is an option to register this in php.ini:
Store in a directory that is not accessible from outside.
In this case, you can complicate the protection system, for example, bind the recent ip and user agent to the identifier, and if they have changed dramatically, ask you to log in again, etc. What fantasy is enough.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question