Re: sessions no longer work
| From: | blackwater dev | Date: | Wed, 09 Aug 2006 15:01:32 +0000 |
| Subject: | Re: sessions no longer work | ||
| References: | 1 2 3 4 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-240376@lists.php.net to get a copy of this message | ||
It doesn't matter if I just surf to the page and they do seem to get the
same phpsessionid..interestingly enough the first three cars are 'BAD'. Not
sure if the path is writable through.
On 8/9/06, Jochem Maas <jochem@iamjochem.com> wrote:
blackwater dev wrote: Sorry if you are getting this multiple times, email is acting a bit screwy. Nope. still doesn't work. Sessions just aren't saved. check that the session save path is writable and have a look to see if you are getting a new session id each time. On 8/9/06, Jochem Maas <jochem@iamjochem.com> wrote:blackwater dev wrote:Hello, I have a site that was coded a while ago. I was just told that theadminside no longer works. I looked and the host recently put php 4.4.2onthesite. I have tried a few things but nothing seems to work. Theproblem isonce you log in the admin page always kicks you back, doesn't see the session vars. What could be wrong? Here is the code: <?php require_once('Connections/db.php'); ?> <? if (isset($_POST["uname"])){$uname=$_POST["uname"]; $pword=md5($_POST["pword"]); $SQL="select * from users where admin=1 and pword='$pword' anduname='$uname'";mysql_select_db($database, $wards);$Result1 = mysql_query($SQL, $wards) or die(mysql_error()); $affected_rows = mysql_num_rows($Result1);if ($affected_rows>0){ session_start(); $_SESSION['wardadmin']="yes";try this here: session_write_close();header("location: admin.php"); }else {$bad="Incorrect username and Password";} } I can echo out the session here and see yes, but I have this code in admin.php <? session_start(); if ($_SESSION['wardadmin']!="yes") { header("location: login.php"); exit; } ?> Thanks!