943,535 Members | Top Members by Rank

Ad:
  • PHP Discussion Thread
  • Unsolved
  • Views: 10596
  • PHP RSS
May 14th, 2004
0

PHP Sessions on IIS

Expand Post »
Does anybody have any insight into using PHP Sessions on an IIS based web server? The problem I am having is that I am using PHP sessions in my counter to make sure that a user is only counted once per visit. It is supposed to ignore them as they click through links on my site. This works great on my Apache based server, but only works for Dial up users on The hosting Service's IIS based server. Broadband users are counted for every click. Tech support informs me that the sessions are in fact being created. the code is as follows:
[PHP]
session_start();
if (!session_is_registered("counted"))
{
mysql_query("UPDATE simplecount SET count=(count + 1) WHERE count_id=1") or die ("unable to UPDATE the database.");
session_register("counted");
}
[/PHP]
Thanks.
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
rwieren is offline Offline
4 posts
since May 2004
May 20th, 2004
0

Re: PHP Sessions on IIS

Quote originally posted by rwieren ...
Does anybody have any insight into using PHP Sessions on an IIS based web server? The problem I am having is that I am using PHP sessions in my counter to make sure that a user is only counted once per visit. It is supposed to ignore them as they click through links on my site. This works great on my Apache based server, but only works for Dial up users on The hosting Service's IIS based server. Broadband users are counted for every click. Tech support informs me that the sessions are in fact being created. the code is as follows:
[PHP]
session_start();
if (!session_is_registered("counted"))
{
mysql_query("UPDATE simplecount SET count=(count + 1) WHERE count_id=1") or die ("unable to UPDATE the database.");
session_register("counted");
}
[/PHP]
Thanks.
URL to the site is: http://rerun.dataegg.com
Reputation Points: 10
Solved Threads: 0
Newbie Poster
rwieren is offline Offline
4 posts
since May 2004
Jun 10th, 2004
0

Re: PHP Sessions on IIS

I'm pretty sure it's a bug\quirk with PHP and IIS. I had a problem with IIS expiring sessions. I tried several ways to expire sessions under IIS and nothing. It would work under an Apache server though. I asked about a million people what could be wrong and no one knew.
Team Colleague
Reputation Points: 262
Solved Threads: 18
a.k.a inscissor
samaru is offline Offline
1,227 posts
since Feb 2002
Jun 11th, 2004
0

Re: PHP Sessions on IIS

Quote originally posted by inscissor ...
I'm pretty sure it's a bug\quirk with PHP and IIS. I had a problem with IIS expiring sessions. I tried several ways to expire sessions under IIS and nothing. It would work under an Apache server though. I asked about a million people what could be wrong and no one knew.
That is what I thought it was, Ijust wanted to know that I am not the only one who thinks that way. I guess I should get them to switch us to Linux/Apache?
Reputation Points: 10
Solved Threads: 0
Newbie Poster
rwieren is offline Offline
4 posts
since May 2004
Jun 11th, 2004
0

Re: PHP Sessions on IIS

Quote originally posted by rwieren ...
That is what I thought it was, Ijust wanted to know that I am not the only one who thinks that way. I guess I should get them to switch us to Linux/Apache?
Well, all I can tell you is that I've had a lot of problems with IIS and PHP regarding sessions. If it's not going to be a hassle switching over, I would recommend it. PHP is made to shine on Linux running Apache. Then again, you could have other apps depending on IIS, so I would consider that as well. If you do decide to run on IIS, make sure you have the newest version with all the patches.
Team Colleague
Reputation Points: 262
Solved Threads: 18
a.k.a inscissor
samaru is offline Offline
1,227 posts
since Feb 2002
Jun 14th, 2004
0

Re: PHP Sessions on IIS

Quote originally posted by inscissor ...
Well, all I can tell you is that I've had a lot of problems with IIS and PHP regarding sessions. If it's not going to be a hassle switching over, I would recommend it. PHP is made to shine on Linux running Apache. Then again, you could have other apps depending on IIS, so I would consider that as well. If you do decide to run on IIS, make sure you have the newest version with all the patches.
Thanks, that is what I will proboaly have to do. My stuff should not be relying on anything that windows exclusively supplies. I programmed it for PHP/CSS/Mysql/Dhtml. to my knowledge none of those are microsoft exclusive technologies. thanks again for the insight.

rwieren
Reputation Points: 10
Solved Threads: 0
Newbie Poster
rwieren is offline Offline
4 posts
since May 2004
Jun 15th, 2004
0

Re: PHP Sessions on IIS

No problem. Let us know if you need any more help/insight.
Team Colleague
Reputation Points: 262
Solved Threads: 18
a.k.a inscissor
samaru is offline Offline
1,227 posts
since Feb 2002

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in PHP Forum Timeline: DB-Authentication php/mysql on Mac OSX v3
Next Thread in PHP Forum Timeline: php wont submit data into the database





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC