Can Cookies Prevent The Page From Loading?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
nickvd
DevNet Resident
Posts: 1027
Joined: Thu Mar 10, 2005 5:27 pm
Location: Southern Ontario
Contact:

Can Cookies Prevent The Page From Loading?

Post by nickvd »

I wrote a very quick "thought" messing system. The user registers and is able to post thoughts. After a thought is posted, they are presented with 3 options (set thought to private, set to private and email to recipients, or purchase a printed thought with a little angel coin).

Whenever the user selects "set to private and email", the browser sends the request, then just hangs. The email goes thru, but the page never re-loads with the success message. The only thing that I have changed since testing the site on the production server is to switch Swift's Connection class from smtp to sendmail ie:

Code: Select all

require_once('Swift.php');
   if ($_config['app']['mailer'] == 'smtp') {
      require_once('Swift/Connection/SMTP.php');
      $swift = $connection = new Swift_Connection_SMTP($_config['app']['smtpserver']);
   } else {
      require_once('Swift/Connection/Sendmail.php');
      $connection = new Swift_Connection_Sendmail;
   }
I have yet to try switching it back to smtp, but I can't believe for a second that using sendmail would cause the browser to have problems (it does the same thing in firefox OR ie...).

I've been able to narrow it down to the sending of the phpsessionid cookie. If I click the archive/email link, it hangs, but if i clear cookies and reload, the page loads fine (albeit no success message as the session has been cleared).

If anyone has any idea what the heck could be happening, I'd be in your debt. I can provide a demo account on the system if you want to see it for yourself.
nickvd
DevNet Resident
Posts: 1027
Joined: Thu Mar 10, 2005 5:27 pm
Location: Southern Ontario
Contact:

Post by nickvd »

Dumping the transactions and errors, I see what looks to be the full transaction log (the last entry is:

Code: Select all

0.10760900 1161465414
response	250 2.0.0 k9LLGrEH029705 Message accepted for delivery
)

That's where the browser hangs, it never finishes loading the page...

<edit>

If I comment out session_start() it loads... So it must (somehow) be session/cookie related... ARGGGHHH!!!
User avatar
akimm
Forum Contributor
Posts: 460
Joined: Thu Apr 27, 2006 10:50 am
Location: Ypsilanti Michigan, formally Clipsburgh

Post by akimm »

Nickvd? Why not use sessions instead, they can redirect the user if they aren't supposed to view a given page, they're easy to use, and they have much functionallity in PHP.
nickvd
DevNet Resident
Posts: 1027
Joined: Thu Mar 10, 2005 5:27 pm
Location: Southern Ontario
Contact:

Post by nickvd »

akimm wrote:Nickvd? Why not use sessions instead, they can redirect the user if they aren't supposed to view a given page, they're easy to use, and they have much functionallity in PHP.
Thanks, but I am already using sessions...
Post Reply