You are here: Re: Very unusual session handling problem. « PHP Programming Language « IT news, forums, messages
Re: Very unusual session handling problem.

Posted by David Gillen on 01/09/07 15:51

Erwin Moller said:
> David Gillen wrote:
>> Erwin Moller said:
>>> David Gillen wrote:
>>>
>>>> Hi. I'm hoping someone here can help.
>>>> I'm setting sessions, with work where cookies are accepted. I've enabled
>>>> trans session id so they should work where cookies aren't. And it seems
>>>> to be working for parts of the site. Unforunately on certain pages it
>>>> isn't picking up the PHPSESSID from the GET variable. To make matters
>>>> worse, I'm doing some URL rewriting to convert
>> ^^^^^^^^^^^^^^^^^^^^^^^^
> Oop, sorry, my bad.
>
>>
>>>> /123/prod.html&PHPSESSID=12345 to prod.php?id=123&PHPSESSID=12345
>>>
>>> Are you sure you are not using mod_rewrite or something?
>>
>> I am using rewriting. I'm wondering though are $_GET variables not
>> available to the rewrite engine?
>
> They should be. They are a part of the url. Post-variables are not.
> Get-variables are.
>
That's what I thought. But from what I could see any thing after ? in the url
(i.e. get variables) wasn't being passed to the rewrite engine.

> What excactly DOES the offending pages receive as url (after the rewrite)?
> You can find such info in:
> $_SERVER["REQUEST_URI"]
> or
> $_SERVER["URL"]
>
> What do they contain?
>
>They they didn't contain the PHPSESSID as per my rewrite rule.
> AFAIK, PHP doesn't care nor know if apache did rewriting, so this is a
> strange problem indeed.

PHP shouldln't care, but seems to have the information from before the
rewrite. Anyway. I've modified my session startup codes, and am now including
the PHPSESSID as part of URLs myself, /id/sub-id/sessid/page.html, and it get
gets rewritten in all cases correctly.
A bit of extra code, but it's working now without cookies which is what the
client wanted.

Many thanks for all suggestions. sorry I couldn't spend more time on it to
figure out what exactly what happening, but this was a fix it yesterday kinda
situation.

D.

 

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

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