how to change the session scope in php?
i am using php to develop web applications. i used session to pass information from one page to other page. but the session is reset when it 开发者_如何学编程comes to other page. i think it is due to wrong scope of sessions(page scope)! am i correct? if it is the problem, then how to overcome the problem? please help me. thanks in advance!
You need to put session_start()
at the beginning of every page - this will start a new session, or, in your case resume a stored session, along with it's variables. This will work unless you call session_destroy()
before navigating to the new page.
Hope this helps,
James
Session doesn't have a scope,may be you are calling session_destroy()
some where in your code
精彩评论