You are here: Re: Aren't session variable preserved using "Header('Location: xxx')"? « PHP Programming Language « IT news, forums, messages
Re: Aren't session variable preserved using "Header('Location: xxx')"?

Posted by d on 01/19/06 12:07

"lwoods" <larry@lwoods.com> wrote in message
news:7gvzf.8968$JT.5454@fed1read06...
> First, I really enjoy working with PHP so I don't want to get something
> started, but I also work with ASP and there is no such thing as "turning
> on and off" session support. It's just there! The only problem that you
> run into is if someone has cookies turned off...but I live with that.

Session support IS always there in PHP, but you don't always want to use it.
Having your sessions enabled for every script regardless of whether you want
them or not is uneccesary overhead.

> Anyway, I'll remember to put "session_start()" at the top of each
> page...and before any headers...which I also discovered the hard way.

Or you can use output buffering, and put it wherever you want ;)

> Thanks to all...
>
> Larry
>
>>> Not really. You call session_start() on those pages which require
>>> session support, and don't on those which don't need sessions. Saves a
>>> little unnecessary processing time.
>>
>> Not to mention the default session handler will only allow two scripts to
>> use the same session at the same time - if sessions were "always on",
>> then you'd get timeouts all over the place.
>>
>>> Maybe session_connect() might be a better name? :-)
>>>
>>> --
>>> ==================
>>> 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

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