TGWSE_GY Posted April 23, 2009 Share Posted April 23, 2009 I am wondering, does $_SESSION need to be started at the beginning of every page or only pages that are going to need to use $_SESSION Variables. Thanks Quote Link to comment Share on other sites More sharing options...
revraz Posted April 23, 2009 Share Posted April 23, 2009 Only on pages that use Sessions. Quote Link to comment Share on other sites More sharing options...
radi8 Posted April 23, 2009 Share Posted April 23, 2009 According to the documentation, it is only necessary on the pages where it is required, but imho, if you are using session variables, then it should be used on every page. Also, look at session.auto_start Quote Link to comment Share on other sites More sharing options...
TGWSE_GY Posted April 23, 2009 Author Share Posted April 23, 2009 So do I just put session_start(); at the top of all the pages that are say in my members area and I will have access to that users assoc array of $_SESSION variables? Quote Link to comment Share on other sites More sharing options...
mattal999 Posted April 23, 2009 Share Posted April 23, 2009 Yes. That is exactly what you should do. Quote Link to comment Share on other sites More sharing options...
tang Posted April 23, 2009 Share Posted April 23, 2009 Consider using an include page if you aren't already. That way you can start your session, check that the member is logged in etc all in 1 file without having to re-type the same code in each file. Quote Link to comment Share on other sites More sharing options...
TGWSE_GY Posted April 23, 2009 Author Share Posted April 23, 2009 thanks guys got it working it went off without a hitch!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.