| | |
PHP Sessions on IIS
Please support our PHP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
Join Date: May 2004
Posts: 4
Reputation:
Solved Threads: 0
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.
[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.
•
•
Join Date: May 2004
Posts: 4
Reputation:
Solved Threads: 0
•
•
•
•
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.
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.
Check out my blog at http://www.shinylight.com for more stuff about web dev.
•
•
Join Date: May 2004
Posts: 4
Reputation:
Solved Threads: 0
•
•
•
•
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.
•
•
•
•
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?
Check out my blog at http://www.shinylight.com for more stuff about web dev.
•
•
Join Date: May 2004
Posts: 4
Reputation:
Solved Threads: 0
•
•
•
•
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.
rwieren
No problem. Let us know if you need any more help/insight.
Check out my blog at http://www.shinylight.com for more stuff about web dev.
![]() |
Similar Threads
- Need help In installing PHP fourm and IIS (PHP)
- Using PHP/MySql with IIS (PHP)
- Php Sessions (PHP)
Other Threads in the PHP Forum
- Previous Thread: DB-Authentication php/mysql on Mac OSX v3
- Next Thread: php wont submit data into the database
| Thread Tools | Search this Thread |
5.2.10 ajax apache api array basic beginner binary broken cakephp checkbox class cms code computing confirm cron curl database date delete display domain dynamic echo email error fatalerror file files folder form forms function functions google href htaccess html iframe image include indentedsubcategory insert interactive ip javascript joomla limit link load login mail malfunction menu mlm msqli_multi_query multiple mysql mysqlquery navigation oop paging parse paypal pdf php procedure query radio ram random reference remote return script search server sessions sockets source space sql syntax system table thesishelp tutorial unset update upload url validation validator variable video web websitecontactform xml youtube






