Reputation: 93
I have a login/register script (php) and users are logged in. But when they visit an extern site (such like paypal to make a donation for the site) after they come back to my site, they are logged out. This is a problem, because i cannot complete the payment transaction automatically, because the user is logged out.
I work with:
$Account->logged
Can anyone help? Or does someone have a suggestion why this is happening?
Greetings and much thanks!
Upvotes: 0
Views: 589
Reputation: 2049
If you call site like this address:
www.site.com
And paypal
back link like this:
http://www.site.com
Or site.com
Session reset. Because your link changed.
So..Redirecting non-www to www with .htaccess
RewriteEngine On
RewriteCond %{HTTP_HOST} !^www\.
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]
Upvotes: 3
Reputation: 26036
Sounds like the session timeout on your sessions is extremely short, or maybe your login system is automatically logging people out when the browser is redirected to a different domain or something like that..?? Should be able to disable something like that pretty easily.
That's the first thing I'd do, though, is check to see if/when the sessions are dying or being cleared.
Upvotes: 0