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

Posted by Scott Bryce on 08/10/07 16:10

amygdala wrote:

> The problem might be PHP related but since I only develop applications using
> PHP, I'm not a hundred percent sure. Therefor I've taken the liberty to
> crosspost to comp.lang.php and alt.www.webmaster. I assume the majority of
> frequent contributors of these groups have dealt with developing session
> management also, so I'm kind of hoping your experience in this field might
> resolve this issue.

I don't code in PHP. I have written my own session management procedures
in Perl. I will answer based on the assumption that PHP uses cookies to
manage sessions.

> User profiles on the site I'm developing will be publically available
> through:
>
> http://www.example.com/profile/view/<username>
>
> A users own profile (when logged in) will be available through:
>
> http://www.example.com/profile/view/ or
> http://www.example.com/profile/ (which will redirect to last url)
>
> So when an anonymous user visits one of these last two pages, the requested
> page is stored as a referer in a session and the user is redirected to
>
> http://www.example.com/user/login/
>
> where the user is prompted to login.
>
> On succes it gets redirected to the stored referer url again. A pretty
> common procedure I would assume.
>
> This works fine on either IE or Firefox (windows). But in Opera I get
> multiple sessions created in the database of which one *does* contains a
> userId but Opera redirects back to the login page again.

(I realize I haven't snipped very well, but I don't know what to remove
and still keep my comments in context.)

Again, I don't know how PHP manages sessions, but what you are saying
here about Opera seems strange to me. If PHP is using a cookie to store
session information in the browser, then there should only be one
session. One cookie can't have multiple values.

BTW, the browser doesn't create sessions in the database. PHP is doing
that. The browser stores session information in a cookie, which can only
contain one value.

> My application examins $_SERVER[ 'REQUEST_URI' ] to determine which page to
> serve.

Why? If you have stored the URL of the page you want to go to in a
cookie, you should be looking for which page to serve in that cookie.

Or are you examining $_SERVER[ 'REQUEST_URI' ] to determine what URL to
store in the cookie? Again, why? If I have a PHP script at
example.com/user/login, why doesn't that script know its own URL? Why
can't the script at example.com/user/login simply store its own URL in
the cookie?

I may be way off base here, but your approach seems odd to me.

 

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

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