S
S
Sasha Brahms2015-11-20 14:36:18
PHP
Sasha Brahms, 2015-11-20 14:36:18

Why is the session not saved?

I save the sessions in the database, take it from there, everything is fine, but when the page is updated, a new session is generated,
with a new session_id ...
as if the cookie storing the session ID is immediately deleted, although I set the lifetime:

session_set_save_handler(...);
ini set...
ini_set('session.gc_maxlifetime',259200);// пробовал и time()+259200
ini_set('session.cookie_lifetime',259200);// пробовал и time()+259200
ini_set....

session_start();

Here is the complete session mechanism: Click
More precisely does not save the session ID, the session itself is saved..
and generates a new ID when refreshed.
How to fix?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
S
shagguboy, 2015-11-20
@shagguboy

session_start?

F
facir, 2015-11-20
@facir

session_start() is placed at the very top
, because first you enable the session mechanism, and then you assign them

S
Sasha Brahms, 2015-11-20
@Dlike

It's decided.
It turned out that one of the components clears cookies under certain conditions...
And deleted the session identifier, I'm sorry..
Thank you all for your help)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question