esport Posted July 20, 2006 Share Posted July 20, 2006 Hi Guys,I am currently using sessions to store my user login. So once they login,[code=php:0]@session_start();if($_POST['login']){$_SESSION['username']=$_POST['username'];}[/code]But when i post a form with a feild 'username' that is not part of the login form, it changes the session vairable that was originally set. It seems the the $_POST is conflicting with the $_SESSION.Any ideas?D Quote Link to comment https://forums.phpfreaks.com/topic/15097-sessions-not-working/ Share on other sites More sharing options...
redarrow Posted July 20, 2006 Share Posted July 20, 2006 [code]<? session_start();$username=($_POST['username']);if($_POST['login']){$_SESSION['username']=$username;}?>[/code] Quote Link to comment https://forums.phpfreaks.com/topic/15097-sessions-not-working/#findComment-60802 Share on other sites More sharing options...
esport Posted July 20, 2006 Author Share Posted July 20, 2006 No, i can set the session OK, its when i POST a form with the same names as the sessions, it seems to be overiding the sessions with the values from the POST even tho im not setting the sessions. Quote Link to comment https://forums.phpfreaks.com/topic/15097-sessions-not-working/#findComment-60804 Share on other sites More sharing options...
redarrow Posted July 20, 2006 Share Posted July 20, 2006 what do you mean i dont understand at allso if you post username what happenspost you full code. Quote Link to comment https://forums.phpfreaks.com/topic/15097-sessions-not-working/#findComment-60824 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.