O
O
Optimus2017-02-23 09:52:10
PHP
Optimus, 2017-02-23 09:52:10

What if the session is needed immediately?

session_start(1800);
var_dump($_SERVER["HTTP_COOKIE"]);

Answer:
Notice: Undefined index: HTTP_COOKIE

because the session has started, but the $_SERVER["HTTP_COOKIE"] variable will only be there when the page is updated or when moving to the next page, but I need a session the first time the visitor enters the first (any) page of the site.
How can you get out of this situation?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
DevMan, 2017-02-23
Pyan @marrk2

what is the connection between the start of the session and the withdrawal of the cookie?
session is available immediately after the start.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question