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!
I declared session in page with session_start() and defined their variables.
in the subsequent pages I am unable to access that variables unless I declare again as session_start(). Plz help me understanding this.
call wrote:if I declare session_start() in every page , does it not mean that everytime a new session to start?
Sessions don't really exist - it just looks like they do.
Session variables are saved in a file after each http request.
On the next http request a session file is opened based on session ID - either sent via GET or stored in a cookie. That's what session_start() does: tells the server to go and unserialise a bunch of vars stored in a particular file (or create a new file if this is the first http request in the session).