Jump to content

Archived

This topic is now archived and is closed to further replies.

esport

Sessions not working??

Recommended Posts

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

Share this post


Link to post
Share on other sites

[code]

<? session_start();

$username=($_POST['username']);

if($_POST['login']){
$_SESSION['username']=$username;
}

?>

[/code]

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
what do you mean i dont understand at all

so if you post username what happens

post you full code.

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.