I am learning PHP and want to pass one variable between two PHP files by using session_start(), I used it …But got a strange result!
when I access the link of php file in web browser I got the right result but when I used post man I got undefined index error!
and that’ll be why you’re getting the bad result - postman isnt preserving your session between page loads, because it dumps cookie data inbetween requests.
No, when PHP starts a session it sends a cookie to the browser. The browser stores that cookie and then sends it along with every request so PHP can resume that same session.
Postman also receives the cookie but immediately forgets it and doesn’t send it along with new requests, so PHP has no way to know it should resume the same session.
The link @m_hutley posted shows you how to make Postman send the cookie so that PHP can resume the session.
Thanks for nice explanation…
I simulated with postman because I am going to use it in Arduino, so I have to find another solution to achieve what I want! with session_start is not possible…Right?