You are here: Re: $_SESSION['loggedin'] not working properly « PHP Programming Language « IT news, forums, messages
Re: $_SESSION['loggedin'] not working properly

Posted by damezumari on 04/17/07 17:05

My webhost has this to say in a kb article re this problem:

PHP Sessions do not work as expected

Symptoms:

* Sessions are not saving when transitioning from HTTP to HTTPS
protocols. If a PHP session needs to begin in HTTP and switch to
HTTPS, there will be some issues where the session is not maintained
across that transition.
* General problems with sessions not seeming to be carried across
web requests.
* Sessions in general behave inconsistently. Your script has a
dependancy on writing data to the /tmp directory.


NOTE: [Although this workaround is intended for a few issues we've
noticed in regards to specific cases, this will most likely fix a
large majority of cases where you're having problems with sessions
working properly - if you are having problems with sessions and your
symptoms don't quite exactly fall into the description above, we
suggest you try this workaround anyway.]

Solution:

This can be fixed by configuring a directive inside of a custom
php.ini file to explicitly direct session files to save in a local
directory on your (gs) Grid-Server instead of the default global '/
tmp' folder.

NOTE: If you are not yet using a custom php.ini file on your server,
you may follow this KB article on the process before proceeding with
the steps in this article.

NOTE: It has been reported that PHPMyAdmin does not work once you make
this change. Here is how to use a desktop database tool as a
workaround to this side effect.

The directive that must be placed inside of your php.ini file is:

session.save_path = /home/####/data/tmp

Where '####' is your actual site number.

so, for s1234.gridserver.com, you would use the following:

session.save_path = /home/1234/data/tmp

After saving these changes, make sure to navigate to your 'data'
directory and create a folder called 'tmp'. The next session created
will start behaving properly and the problem should no longer occur.

+++

Great! I will have to give up PHPMyAdmin for them to fix the problem!

No way! I rather look for another web host!

By the way, I have tested this a bit further. After visiting from
three to twelve pages I lose the session variable for loggedin. I have
swtiched between the same pages and it happens sooner or later.

Regards,

Jan Nordgreen

 

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

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