Jump to content

Sessions & Mails... Major problems in one thread.


Bencori

Recommended Posts

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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:<xxxx@xxxxxxxxxxx.xxx>
RCPT TO:<harrypotter@yopmail.com>

MIME headers :
Received: from apache by hosting.anonhoster.com with local (Exim 4.69)
(envelope-from <xxxx@xxxxxxxxxxx.xxx>)
id 1PximR-0000dg-Jx
for harrypotter@yopmail.com; Thu, 10 Mar 2011 17:32:03 +0100
To: harrypotter@yopmail.com
Subject: Hello There
X-PHP-Script: xxxxxxxxxxx.xxx/mail.php for 178.73.198.9
From: admin@xxxxxxxxxxx.xxx "\r\n" .
Reply-To: admin@xxxxxxxxxxx.xxx "\r\n" .
"Content-type: text/html; charset=iso-8859-1\r\n".
X-Mailer: PHP/5.2.10
Message-Id: <E1PximR-0000dg-Jx@hosting.anonhoster.com>
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:<xxxx@server.xxxxxxxxxxx.xx>
RCPT TO:<harrypotter@yopmail.com>

MIME headers :
Received: from xxxx by server.xxxxxxxxxxx.xx with local (Exim 4.69)
(envelope-from <xxxx@server.xxxxxxxxxxx.xx>)
id 1PximL-0001w1-R1
for harrypotter@yopmail.com; Thu, 10 Mar 2011 11:31:57 -0500
To: harrypotter@yopmail.com
Subject: Hello There
X-PHP-Script: xxxxxxxxxxx.xx/mail.php for 178.73.198.9
From: admin@xxxxxxxxxxx.xx "\r\n" .
Reply-To: admin@xxxxxxxxxxx.xx "\r\n" .
"Content-type: text/html; charset=iso-8859-1\r\n".
X-Mailer: PHP/5.2.17
Message-Id: <E1PximL-0001w1-R1@server.xxxxxxxxxxx.xx>
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!

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.