blueman378 Posted March 11, 2008 Share Posted March 11, 2008 hi guys i was playing today and noticed how easily my sessions are being overwrote eg using this code: <? session_start(); $_SESSION['level'] = 3; echo $_SESSION['level']; $level = 1; echo $_SESSION['level']; ?> it outputs: 31 are sessions meant to be overwrote this easily? or am i doing something wrong with my coding, i can use nonuniform names eg gtxlevel but i would prefer not to and be able to define variables also and undeerstad both Quote Link to comment Share on other sites More sharing options...
PFMaBiSmAd Posted March 11, 2008 Share Posted March 11, 2008 That is caused by register globals. Either turn register globals off or use unique names for program/post/get/cookie/session variables. Quote Link to comment Share on other sites More sharing options...
Northern Flame Posted March 11, 2008 Share Posted March 11, 2008 or its probably because u have nothing separating your data, <? session_start(); $_SESSION['level'] = 3; echo $_SESSION['level']; echo "<br />"; $level = 1; echo "<br />"; echo $_SESSION['level']; ?> 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.