Reply to Re: sessions and redirecting in opera

Your name:

Reply:


Posted by amygdala on 08/13/07 01:17

"Jerry Stuckle" <jstucklex@attglobal.net> schreef in bericht
news:xqKdnb9U2fBnMyLbnZ2dnUVZ_uLinZ2d@comcast.com...
> amygdala wrote:
>>
>> This thing still has me puzzled. What I did is the following:
>>
>> My SessionHandler class has the following method:
>>
>> public function redirect( $url )
>> {
>> session_write_close();
>> header( 'Expires: Mon, 26 Jul 1997 05:00:00 GMT' );
>> header( 'Last-Modified: ' . gmdate( 'D, d M Y H:i:s' ) . ' GMT' );
>> header( 'Cache-Control: no-store, no-cache, must-revalidate' );
>> header( 'Cache-Control: post-check=0, pre-check=0', false );
>> header( 'Pragma: no-cache' );
>> header( 'HTTP/1.0 302 Moved Temporarily' );
>> header( 'Location: ' . $url );
>> // this part between the comments is important
>> echo 'You\'re being redirected to ' . $url . ' .
>> Click <a href="' . $url. '">here</a> if it doesn\'t work';
>> // end important part
>> exit(); // exit doesn't really make a difference for Opera
>> }
>>
>> Since I have now included the exit() statement I am sure that this is the
>> last thing done by the application when redirecting. Also, I have added
>> cache control headers and the likes. But still in Opera the problem
>> persists if I leave out the echo part you see above between the comments.
>>
>> So, from my experience it seems as if Opera wants some body content for
>> the redirect to work and revalidate the url I landed on before I had to
>> log in.
>>
>> Does anyone have any other clue as to what might be going on here?
>>
>> Thanks.
>
> Why are you sending a message they will never see, anyway? Normally a
> redirect header has NO text associated with it.
>
> If you have your header set up appropriately, they will be redirected. All
> the message might do is screw things up for the browser.

Because as Rik has pointed out earlier: some browsers might not obey the
request for a redirect. I predominantly browse using Opera, and in Opera,
you can also *choose* not to be redirected automatically. So having said
that, it makes sense to add an extra option for visitors, when they are not
redirected automatically.

[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

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