User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the PHP section within the Web Development category of DaniWeb, a massive community of 391,912 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,666 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our PHP advertiser: Lunarpages PHP Web Hosting
Views: 6432 | Replies: 6
Reply
Join Date: May 2004
Posts: 4
Reputation: rwieren is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
rwieren rwieren is offline Offline
Newbie Poster

PHP Sessions on IIS

  #1  
May 14th, 2004
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.
AddThis Social Bookmark Button
Reply With Quote  
Join Date: May 2004
Posts: 4
Reputation: rwieren is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
rwieren rwieren is offline Offline
Newbie Poster

Help Re: PHP Sessions on IIS

  #2  
May 20th, 2004
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
Reply With Quote  
Join Date: Feb 2002
Location: Long Island, NY
Posts: 1,134
Reputation: samaru is just really nice samaru is just really nice samaru is just really nice samaru is just really nice 
Rep Power: 12
Solved Threads: 2
Colleague
samaru's Avatar
samaru samaru is offline Offline
a.k.a inscissor

Re: PHP Sessions on IIS

  #3  
Jun 10th, 2004
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.
_.:: my websites ::._
blog @ www.samaru.net * engi No Jutsu @ www.narutorp.net * portfolio @ shinylight.com
deviantART: inscissor
Reply With Quote  
Join Date: May 2004
Posts: 4
Reputation: rwieren is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
rwieren rwieren is offline Offline
Newbie Poster

Re: PHP Sessions on IIS

  #4  
Jun 11th, 2004
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?
Reply With Quote  
Join Date: Feb 2002
Location: Long Island, NY
Posts: 1,134
Reputation: samaru is just really nice samaru is just really nice samaru is just really nice samaru is just really nice 
Rep Power: 12
Solved Threads: 2
Colleague
samaru's Avatar
samaru samaru is offline Offline
a.k.a inscissor

Re: PHP Sessions on IIS

  #5  
Jun 11th, 2004
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.
_.:: my websites ::._
blog @ www.samaru.net * engi No Jutsu @ www.narutorp.net * portfolio @ shinylight.com
deviantART: inscissor
Reply With Quote  
Join Date: May 2004
Posts: 4
Reputation: rwieren is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
rwieren rwieren is offline Offline
Newbie Poster

Solution Re: PHP Sessions on IIS

  #6  
Jun 14th, 2004
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
Reply With Quote  
Join Date: Feb 2002
Location: Long Island, NY
Posts: 1,134
Reputation: samaru is just really nice samaru is just really nice samaru is just really nice samaru is just really nice 
Rep Power: 12
Solved Threads: 2
Colleague
samaru's Avatar
samaru samaru is offline Offline
a.k.a inscissor

Re: PHP Sessions on IIS

  #7  
Jun 15th, 2004
No problem. Let us know if you need any more help/insight.
_.:: my websites ::._
blog @ www.samaru.net * engi No Jutsu @ www.narutorp.net * portfolio @ shinylight.com
deviantART: inscissor
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

DaniWeb PHP Marketplace
Thread Tools Display Modes

Similar Threads
Other Threads in the PHP Forum

All times are GMT -4. The time now is 7:52 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC