You are here: Re: Sessions - Not working with IE « PHP Programming Language « IT news, forums, messages
Re: Sessions - Not working with IE

Posted by Steve Wright on 10/26/06 09:23

On Oct 26, 9:49 am, Erwin Moller
<since_humans_read_this_I_am_spammed_too_m...@spamyourself.com> wrote:
> Steve Wright wrote:
> > Forgive my ignorance, but I am just starting to learn about sessions in
> > PHP and how to pass data from one page to the next. What I'm about to
> > explain could just be my misunderstanding of how sessions work.
>
> > I have two test scripts. The first starts a session, displays a few
> > details and a form. When the form is submitted it jumps to the second
> > page. The first script looks like this.
>

[script snipped]

>
> > The second script displays the same variables as the first. In addition
> > it dislpays the value of a variable passed by the _$SESSION array and a
> > value passed via a form. It looks like this.
>

[Script snipped]

>
> > When run under IE6, I get the following output.
>
> > Script 1
>
> > · Your session id is d7e201df8eb6ac9fd76915e53051666d
> > · The SESSION array contains
> > Array ( [session_var] => testing )
> > · The SID is PHPSESSID=d7e201df8eb6ac9fd76915e53051666d
> > · PHPSESSID =
>
> > Script 2
>
> > · Your session id is 40211048ab6869c74dc8e9dff6098dc0
> > · The SESSION array contains
> > Array ( )
> > · The SID is PHPSESSID=40211048ab6869c74dc8e9dff6098dc0
> > · PHPSESSID =
> > · session_var = {}
> > · form_var = {testing}
>
> > Note how the session id is different and the variable passed by the
> > _$SESSION array is blank.
>
> > When run under Firefox 2.0 I get the following;
>
> > · Your session id is 00802b0742fdb87cda553cba85027c30
> > · The SESSION array contains
> > Array ( [session_var] => testing )
> > · The SID is PHPSESSID=00802b0742fdb87cda553cba85027c30
> > · PHPSESSID =
>
> > and
>
> > · Your session id is 00802b0742fdb87cda553cba85027c30
> > · The SESSION array contains
> > Array ( [session_var] => testing )
> > · The SID is
> > · PHPSESSID =
> > · session_var = {testing}
> > · form_var = {testing}
>
> > This time, the session ids are the same and the variable is passed.
>
> > Any ideas why the difference?
> > With Firefox, why is SID populated on the first page and not the
> > second?
> > Why is PHPSESSID blank?
>
> > In case it helps, the values from the php.ini file for session are;
>
> > session.auto_start = 0
> > session.cache_expire = 180
> > session.cache_limiter = nocache
> > session.cookie_domain =
> > session.cookie_lifetime = 0
> > session.cookie_path = /
> > session.entropy_file =
> > session.entropy_length = 0
> > session.gc_maxlifetime = 1440
> > session.gc_probability = 1
> > session.name = PHPSESSID
> > session.referer_check =
> > session.save_handler = files
> > session.save_path = /tmp
> > session.serialize_handler = php
> > session.use_cookies = 1
> > session.use_trans_sid = 1
>
> > Regards
> > Steve WrightHi Steve,
>
> This is strange indeed.
> Did you by any chance disable cookies on IE?
>
> Also look for a ini value named:
> session.use_only_cookies
> (That one is added in version 4.3)
>
> Or are you maybe using an older version of PHP?
> (If so, please upgrade.)
>
> Regards,
> Erwin Moller

As far as I can tell, I have not disabled cookies. The website runs in
the trusted zone and the security level on that zone is set to "Low".
Is there any other settings I should be checking in IE6?

The session.use_only_cookies is not defined in the php.ini. According
to my book (APRESS Beginning PHP and MySQL5 by Jason Gilmore), the
default value for this is 0.

>From the phpinfo() call, the session section says the following

Directive Local Value Master Value
session.auto_start Off Off
session.bug_compat_42 On On
session.bug_compat_warn On On
session.cache_expire 180 180
session.cache_limiter nocache nocache
session.cookie_domain no value no value
session.cookie_lifetime 0 0
session.cookie_path / /
session.cookie_secure Off Off
session.entropy_file no value no value
session.entropy_length 0 0
session.gc_divisor 100 100
session.gc_maxlifetime 1440 1440
session.gc_probability 1 1
session.hash_bits_per_character 4 4
session.hash_function 0 0
session.name PHPSESSID PHPSESSID
session.referer_check no value no value
session.save_handler files files
session.save_path no value no value
session.serialize_handler php php
session.use_cookies On On
session.use_only_cookies Off Off
session.use_trans_sid 0

We are running PHP v5.0.4

I wouldn't mind if it worked under IE and not FF, but this is an
intranet application and IE6 is the company standard :-(

 

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

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