ajax - Pass session ID to multiple PHP scripts within on HTML page -


i have single html page uses carousel style log in system. each step in sign works off of different php script. there 3 forms on page appear user progresses through sign up. progress need keep user id first step in variable in order update parts of account later on.

the forms executed via ajax , first php script calls

session_start(); 

and sets session variable

$_session['user_id']=$account_id; 

as progress through form put @ top check if session variable passing through

if (empty ($_session['user_id'])) { $message = 'cant find session id';} 

and not. don't have session_start() @ top of other php scripts.

am misunderstanding how pass variable?

session_start(); needs called @ beginning of each page load in order make $_session available.

don't worry, won't reset session. in simplest terms, session_start() tells php expecting session exist, , needs run code give access it.


Comments

Popular posts from this blog

jQuery Mobile app not scrolling in Firefox -

c++ - How to add Crypto++ library to Qt project -

php array slice every 2th rule -