This is a discussion on sessions in FF and IE within the alt.comp.lang.php forums, part of the PHP Programming Forums category; Hello all, I use sessions to store some information which I can use in all the pages of my website. ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
Hello all,
I use sessions to store some information which I can use in all the pages of my website. This works fine in FF(1.5) but in IE (7) I have a new session in every page? I checked my code I do a session_start() once at the top of the pages. Is there a setting in IE which forces to start a new session? in IE I have enabled cookies for all sites, I disabled all browser addons. What am I missing. Is there anybody out there who knows how to solve this? I looks like this is not a PHP problem but maybe sombody has encountered the same problem and has an answer for me. thanks in advance |
|
|||
|
You should use
if (! session_id ()) session_start (); instead of just session_start(). Regards, Hans "Chello" <...> wrote in message news:d27f2$46028f2b$3ea34df4$7452@news.chello.nl.. . > Hello all, > > I use sessions to store some information which I can use in all the pages of > my website. This works fine in FF(1.5) but in IE (7) I have a new session in > every page? I checked my code I do a session_start() once at the top of the > pages. > Is there a setting in IE which forces to start a new session? > > in IE I have enabled cookies for all sites, I disabled all browser addons. > What am I missing. Is there anybody out there who knows how to solve this? > > I looks like this is not a PHP problem but maybe sombody has encountered the > same problem and has an answer for me. > > thanks in advance > > |
|
|||
|
"pritaeas" <pritaeas@hotmail.com> writes:
>> I use sessions to store some information which I can use in all the pages > of >> my website. This works fine in FF(1.5) but in IE (7) I have a new session > in >> every page? I checked my code I do a session_start() once at the top of > the >> pages. >> Is there a setting in IE which forces to start a new session? >> >> in IE I have enabled cookies for all sites, I disabled all browser addons. >> What am I missing. Is there anybody out there who knows how to solve this? >> >> I looks like this is not a PHP problem but maybe sombody has encountered > the >> same problem and has an answer for me. >> >> thanks in advance > You should use > > if (! session_id ()) session_start (); > > instead of just session_start(). > Not sure if you really need to check, the documentation for session_start says it will resume a session if already present. We do a lot of session stuff in PHP and just use session_start(). Hope this helps. -- John __________________________________________________ _________________ John Murtari Software Workshop Inc. jmurtari@following domain 315.635-1968(x-211) "TheBook.Com" (TM) http://thebook.com/ |
|
|||
|
Chello wrote:
> Hello all, > > I use sessions to store some information which I can use in all the pages of > my website. This works fine in FF(1.5) but in IE (7) I have a new session in > every page? I checked my code I do a session_start() once at the top of the > pages. > Is there a setting in IE which forces to start a new session? > > in IE I have enabled cookies for all sites, I disabled all browser addons. > What am I missing. Is there anybody out there who knows how to solve this? > > I looks like this is not a PHP problem but maybe sombody has encountered the > same problem and has an answer for me. I've heard about more people having this problem with MSIE 7. Haven't yet heard the solution though. Try to determine wether MSIE accepts the session. If you're using cookies, check wether it came back or not. If it didn't, there's a reason MSIE rejected it. Try to play around with the session constants (http://www.php.net/manual/en/ref.session.php) untill it does accept it. HTH, -- Rik Wasmus Estimated date being able to walk again: 01-05-2007. Less then a week, hurray! |