Bencori Posted March 10, 2011 Share Posted March 10, 2011 Hello everyone, it's my first post here. I was recommend this community for it's professionalism and "friendlyness". During my stay here, please excuse my english. I know it can be unpleasant for you to read a thread with terrible grammar, I hate it in my native language, I'll do my best. Okay, so I'm having two major issues for my website to operate like I'd like it to, I've done everything I knew about, and I can't think about anything else Google didn't help me much either this time. First one is that I seem to have a cookies/sessions problem. Well, I use Liberty Reserve to allow my members to top up their account. So I send my form to their SCI and when I either cancel or complete a transaction, I return to my website but I'm not logged in anymore! So the auto-add to balance system can't work. Alright, when I saw this I was only using sessions, so I added cookies so I could rely on them too. And there again, same thing. Doubled, tripled checked all the LR settings and everything, I know they are right. But what's really, really, weird to me and what's really doing my head in is that I'm not actually logged out, because if I use another tab/window I'm still logged in. In other words, it's only the window coming back from Liberty Reserve that won't log in. The cookies are still here and so is the session so... Another terrible thing is that it used to work when I was on my previous host (just moved to a dedicated server, which may be causing the problems, it's the first time I administrate a dedi). This is blocking my entire website from working. And my second problem is with the function mail() -there again 'caused' by new server-. I don't get any error message, or anything. The e-mails with cPanel/WHM work great. Though, I have done several tests and it never reaches my Gmail, Hotmail or Yahoo account. It did work with a Yopmail inbox though. So, I was focusing on 'why isn't it sending it' but since I just noticed it worked with Yopmail, I'm sure it is sending it and have no ideas why wouldn't it work with other e-mail service providers. I hope you understood what I meant and that, hopefully, you guys can help me out with those totally handicapping issues. Thank you, Regards. -Ben. Quote Link to comment https://forums.phpfreaks.com/topic/230156-sessions-mails-major-problems-in-one-thread/ Share on other sites More sharing options...
btherl Posted March 10, 2011 Share Posted March 10, 2011 Have you tried other browsers for the session issue? I'm not suggesting you ask everyone to change browser, but it may help to debug the problem if it works in some browsers but not others. You may also want to log the headers your browser is sending. You can do this in Firefox with the LiveHTTPHeaders extension. Then you can see if the session cookie is being sent. As for the mail() issue, have you asked the hosting provider about it? You might be able to resolve it by using an external SMTP service instead of the system mail(). It could be caused by other people on your host spamming, resulting in some sites not accepting email from it. Quote Link to comment https://forums.phpfreaks.com/topic/230156-sessions-mails-major-problems-in-one-thread/#findComment-1185316 Share on other sites More sharing options...
DavidAM Posted March 10, 2011 Share Posted March 10, 2011 Also, on the mail() issue, did you change the from address that you use in your code? The mail clients (Gmail, etc) will probably consider a mail as spam if the from address does not match the server actually sending the mail. Did you check the junk/spam folders in your inbox to see if the mail is there? Quote Link to comment https://forums.phpfreaks.com/topic/230156-sessions-mails-major-problems-in-one-thread/#findComment-1185348 Share on other sites More sharing options...
Bencori Posted March 10, 2011 Author Share Posted March 10, 2011 Thanks guys for replies. Yes, btherl, I have tried different browser and same thing happens. What shall I be looking for in the header? I did contact the hosting company, but I'm on a dedicated server, so this is not an authorization problem I don't think. I'm expecting a reply from them soon. DavidAM, I have, of course, checked the spam/junk folders. It's not in there. It appears like it doesn't even reach my e-mail account. Quote Link to comment https://forums.phpfreaks.com/topic/230156-sessions-mails-major-problems-in-one-thread/#findComment-1185364 Share on other sites More sharing options...
btherl Posted March 10, 2011 Share Posted March 10, 2011 Bencori, the things to look for in the headers are described here: http://en.wikipedia.org/wiki/HTTP_cookie#Implementation The request from your browser should be sending a Cookie: header, and the browser should be responding with a Set-cookie: header on each request. The cookie will have the name PHPSESSID Quote Link to comment https://forums.phpfreaks.com/topic/230156-sessions-mails-major-problems-in-one-thread/#findComment-1185395 Share on other sites More sharing options...
Bencori Posted March 10, 2011 Author Share Posted March 10, 2011 Okay. Thanks. I fixed this. It was actually working alright, just needed to change my cookies names, to avoid old ones being replaced but not correctly updated with new one (stupid I didn't think about it earlier. Spent all night pulling my hairs at it, this morning I simply cleaned my cookies and it worked...). So now, moving onto next issue which is giving me as much of headache: the e-mails. I now know it's working, I mean the e-mail ARE sent. They just don't pass the spam filter of Gmail, Yahoo, etc. So everything lies here. I have tried using my old host & my new server. Same script, same content, same everything: one goes in spam (I can use yopmail to see this) and one doesn't. I have got the headers of each mails and there they are: This one WILL work: SMTP headers : IP:xx.xx.xxx.x EHLO hosting.anonhoster.com MAIL FROM:<[email protected]> RCPT TO:<[email protected]> MIME headers : Received: from apache by hosting.anonhoster.com with local (Exim 4.69) (envelope-from <[email protected]>) id 1PximR-0000dg-Jx for [email protected]; Thu, 10 Mar 2011 17:32:03 +0100 To: [email protected] Subject: Hello There X-PHP-Script: xxxxxxxxxxx.xxx/mail.php for 178.73.198.9 From: [email protected] "\r\n" . Reply-To: [email protected] "\r\n" . "Content-type: text/html; charset=iso-8859-1\r\n". X-Mailer: PHP/5.2.10 Message-Id: <[email protected]> Date: Thu, 10 Mar 2011 17:32:03 +0100 This one WON'T work: SMTP headers : IP:XX.XX.XX.XXX EHLO server.xxxxxxxxxxx.xx MAIL FROM:<[email protected]> RCPT TO:<[email protected]> MIME headers : Received: from xxxx by server.xxxxxxxxxxx.xx with local (Exim 4.69) (envelope-from <[email protected]>) id 1PximL-0001w1-R1 for [email protected]; Thu, 10 Mar 2011 11:31:57 -0500 To: [email protected] Subject: Hello There X-PHP-Script: xxxxxxxxxxx.xx/mail.php for 178.73.198.9 From: [email protected] "\r\n" . Reply-To: [email protected] "\r\n" . "Content-type: text/html; charset=iso-8859-1\r\n". X-Mailer: PHP/5.2.17 Message-Id: <[email protected]> Date: Thu, 10 Mar 2011 11:31:57 -0500 The only difference I see is that in the first one it's sent from my domain name, and in second example it's seems to be my server's name (server.xxxxxxxxxxx.xx). Banging my head against the wall! Quote Link to comment https://forums.phpfreaks.com/topic/230156-sessions-mails-major-problems-in-one-thread/#findComment-1185687 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.