Reply to Re: Session Problem - could it be cos of register_globals?

Your name:

Reply:


Posted by Matthew on 11/19/07 19:49

Rik Wasmus emailed this:
> On Mon, 19 Nov 2007 20:38:05 +0100, Rik Wasmus
> <luiheidsgoeroe@hotmail.com> wrote:
>
>> On Mon, 19 Nov 2007 20:25:25 +0100, Matthew <matthew@spamkiller.com>
>> wrote:
>>> My server runs PHP version 4.4.3.
>>>
>>> I'm successfully creating a session and can set and retrieve my own
>>> session variables.
>>
>> OK
>>
>>> As far as I can tell the $_SESSION['uid'] variable should be created
>>> automatically when session_start() is called. When I retrieve this
>>> variable however it is empty.
>>
>> Nope. Unless you name it that way.
>> <http://nl2.php.net/manual/en/ref.session.php>
>>
>> The default 'session.name' is PHPSESSID, which you can normally will
>> NOT find in $_SESSION, but in one of the $_REQUEST arrays (and thus
>> obviously in $_REQUEST). $_COOKIE['PHPSESSID'] _if_ the session works
>> with cookies, optionally in the $_POST or $_GET array in case of a
>> transparant session id (which is not recommandable).
>>
>> If you choose another name for a session, this should be done with
>> session_name('custom_name_of_session') BEFORE the call to
>> session_start():
>> <http://nl2.php.net/manual/en/function.session-name.php>

Thanks for both replies Rik.

> Addendum: if you're just curious what your session id actually is, use
> session_id().

What about the cookie, how do I retrieve that, I need to add it to a
database table?

Cheers and sorry for the newbie questions.

[Back to original 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

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