You are here: Re: login problem « All PHP « IT news, forums, messages
Re: login problem

Posted by Jerry Stuckle on 02/01/08 01:46

white lightning wrote:
> On Jan 31, 11:32 pm, Jerry Stuckle <jstuck...@attglobal.net> wrote:
>> Did you do as I said - put another value in the $_SESSION array duringloginwhich is NOT cleared when you log out?
>>
>
> well this is what i did in the logout() function in my User class..
> function _logout() {
> $query = "UPDATE member SET cookie='', session='',
> ip='' WHERE
> member_id='{$_SESSION['uid']}'";
> mysql_query($query) or die("Could not select");
>
> $_SESSION['logged'] = false;
> //$_SESSION = array();
> //session_destroy();
> return true;
> }
>
> I commented out 2 lines that is supposed to keep the session array as
> it is after logout but the result is same as before. Is that what you
> are asking me to do? something like this, right?
>

OK, that should help. It means the session isn't being destroyed - but
it is being lost.

BTW - I just noticed - you should NEVER set $_SESSION to array() (or
anything else). Just set the items within the array. When you set
$_SESSION itself to something, it loses it's superglobal status.
Rather, you should unset() the elements you no longer need.

And you shouldn't destroy the session - it may very well have
information from other parts of your code. Maybe not now, but later.


>> Also, did you enable the E_NOTICE errors display?
>>
>
> when i add "error_reporting(E_ALL);" or "error_reporting(E_NOTICE);"
> in my code, I get the following error after I press the "login"
> button.. but normal browsing is ok..
>
> Error 405 Method Not Allowed
>
> The requested method POST is not allowed for URL
>

OK, that's a start. What page are you trying to post to?

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация