Jump to content

session problem


MoMoMajor

Recommended Posts

Ok so I have been working on a site for a few days and I got the site working on localhost on my comp perfectly. Sessions, database and all that.

 

I get hosting online and now my sessions don't work. The user will log in and it will welcome them and direct them to their page but after they click they are automatically logged out because none of the session variables work.

 

Is there something you have to change when you go with actual hosting or something?

Link to comment
https://forums.phpfreaks.com/topic/168613-session-problem/
Share on other sites


if (isset($_POST['submitlogin'])) {

			//check username 
			if (($_POST['page_user'] == $usersnme) && (md5($_POST['page_pass']) == $userspass)) {
				$_SESSION['user_name'] = $user_name;
				$_SESSION['user']= 'admin';					
				echo "Thank you for logging in<strong> ".$_SESSION['user_name']."[".$_SESSION['user']."]</strong>";
				echo "Please click <a alt='home' title='Go' class='' href='../{$page_url}'>here<br/><br/></a>";	
				die();
			} else if ((md5($_POST['p_pass']) == $p_pass) && ($_POST['p_user'] != $usersnme))  {
				$_SESSION['user'] = 'participant';
				$_SESSION['user_name'] = $_POST['page_user'];
				$_SESSON['users_pass'] = $page_password;
				echo "Thank you for logging in ".$_SESSION['user_name'];

				echo "<br><br><strong>Please click <a href='../".$page_url."/'>here</a></strong> <br><br>";	
				die();				
			} 


			}

 

 

The problem is that once the user clicks the button the sessions disappear and it is really frustrating seeing as I had it working perfect on my machine  :facewall: :facewall: :facewall:

 

I started the session at the start of the page.

Link to comment
https://forums.phpfreaks.com/topic/168613-session-problem/#findComment-889440
Share on other sites

Archived

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

×
×
  • Create New...

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.