Jump to content

Session Problem


Cod-nes
 Share

Recommended Posts

The Session doesn't want to be created.

<?phpinclude('config.php'); // Doesn't contain <html> or <body>session_start();$_SESSION['pass']=md5($pass); // $pass is from config.php?>

config.php

<?php # Something$username="test";$password="098f6bcd4621d373cade4e832627b4f6";$title="test";$seconds=30;function showfooter(){$display='<div class="ct">Affiliates</div><div class="cc"><marquee direction="left" scrollamount="3" onmouseover="this.stop()" onmouseout="this.start()"><script src="affiliates.js"></script></marquee></div>';$copy=true;$title="test";echo $display;echo '<div style="border-width:1px" class="ca">';if($copy==true){echo 'Powered by <a href="http://a.com">A</a> © 2009';}else{echo $title . " bah bah bah";echo "</div>";if(file_exist("footer.php")){include("footer.php");}}}?>

Edited by Cod-nes
Link to comment
Share on other sites

in the config.php u posted u have $password, not $pass, or have u set $pass somewhere else?in the last line of config.php u also have file_exist instead of file_existscan u set error_reporting at E_ALL|E_STRICT and see if you get any errorsand try var_dump(session_id()); after session_start(); to see if the session gets made or not (if it gives an empty string it doesnt get made)

Link to comment
Share on other sites

in the config.php u posted u have $password, not $pass, or have u set $pass somewhere else?in the last line of config.php u also have file_exist instead of file_existscan u set error_reporting at E_ALL|E_STRICT and see if you get any errorsand try var_dump(session_id()); after session_start(); to see if the session gets made or not (if it gives an empty string it doesnt get made)
I have set $pass elsewhere. This file is being included by another file (index.php).
Link to comment
Share on other sites

I changed the file to be more simple...

<?php$pass2=$_POST["pass2"];$user2=$_POST["user2"];session_start();$_SESSION['user']=$user2;$_SESSION['pass']=md5($pass2);var_dump(session_id());function jtw_ymam($e) {  echo '<div class="ct">Error ' . $e . '</div><div class="cc">Wrong username, password, or even something else. <a href="index.php?ap=">Try again</a></div>'; }// Let's add config.phprequire ("config.php"); // Sighs lets check if the username is validif(!($_SESSION['user']==$username)) {  jtw_ymam("1"); }else {  // Username exists. Now we shall check the password.  if(!($_SESSION['pass']==$password))   {	jtw_ymam("2");   }  else   {echo "TEST!";   } }?>

Same Config.php file.And a simple form on another page.The strange thing is that var_dump(session_id()); shows the info, but there is no cookie/session in firefox 3. And I get the error that the session['user'] doesn't equal to $username.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...