Jump to content

Recommended Posts

I am createing a simply quiz site, where in order to participate in the quiz, you must first be logged in.

While working on my local machine, the code works perfectly.

I use the followin to create a session ID;

$_SESSION['SESS_ID'] = $member['id'];

 

Then, on my main page where i want dynamic code i include the following;

 

if(!isset($_SESSION['SESS_ID']) || (trim($_SESSION['SESS_ID']) == '')) {

 

 

print ("

<div style='float:left; width:400px; height:215px; margin-left:500px;'>

<form class='login' method='post' action='login-form.php' style='float:right; margin-top:120px;' >

 

<input type='submit' class='button' name='submit' value='Sign In' style='float:right ; margin-right:20px;'>

 

</form>

<p style=' margin-top:170px; margin-left:160px;'>New Member? Start <a href='register-form.php'>Here</a></p>

</div>

"

);

}

else {

print "<h4 style='float:right; text-align: right; margin-top:150px; margin-right:50px;'>Welcome ". $_SESSION['SESS_NAME']. " <a href='logout.php'  style='float:right; text-align:right;'>Sign Out</a></h4>

";

 

 

For some reason, when the site is on the server, the session ID does not seam to get passed along.

Any Ideas how to remediy this?

the website is kingdomquiz.com if anybody is interested.

Link to comment
https://forums.phpfreaks.com/topic/253576-php-member-login-session-issue/
Share on other sites

You likely have a php.ini configuration difference between your development system and the live server or a problem with the session configuration on the live server.

 

Do you have php's error_reporting set to E_ALL and display_errors set to ON (temporarily) on the live server so that any php detected errors will be reported and displayed to help point out problems that are occurring?

 

Have sessions ever worked on the live server or not just for the the code you are trying now?

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.