You are here: Re: sessions and redirecting in opera « PHP Programming Language « IT news, forums, messages
Re: sessions and redirecting in opera

Posted by amygdala on 08/13/07 10:04

amygdala wrote:
> Rik wrote:
>> On Mon, 13 Aug 2007 00:24:18 +0200, amygdala <noreply@noreply.com>
>>>
>>> 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.
>>
>> Can you set this up somewhere accessable? I'm curious what happens if
>> I try it in Opera here. Never gave me problems before.
>
> Hi Rik,
>
> I've set up little example (without the echo part in the redirect
> method) which you should be able to access temporarily through:
>
> http://amygdala.kicks-ass.net/profile/
>
> (Please let me know if you are not able to access it.)
>
> If all goes well, this will automatically redirect you to the login
> page. From there on use:
>
> username: demo
> password: demodemo (yes, 8 chars)
>
> In my Opera version (9.02) this brings up the login page again,
> instead of redirecting me to
>
> http://amygdala.kicks-ass.net/profile/view/demo
>
> When I manually go to the above url after logging in, I do get to see
> a var_dump as intended.
>
> Bedankt alvast! (Thank you in advance)

Alright, this is strange:

When I access my own example through a proxy (using the above url) it works
as intended. Come to think of it, I do recall reading somewhere that Opera
sometimes has problems with cookies when developing on a localhost server.

Are you aware of any such thing?

 

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

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