PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
when I call following page independently, I can see value of session. but when I want get it by file(); command sessions work only for which sessions that defined newly.
Using file or file_get_contents you are using a different session. If you open the page with you browser, your browser is the client and is storing the cookie with the session id, but if you open it from Apache, your client is Apache and the session id is different