Jump to content

Recommended Posts

Hi I have a session code I use on a clients website. If they elect to pay for more benefits they are redirected to paypal. When they are done they are then redirected to a confirmation page which will update their membership.

 

Some are being redirected back fine, others are having the session end and sent back to a login page where they aren't confirmed and have to be added manually. Is this a browser issue or my code? Can anyone help?

 

<?php
session_start();
if(!session_is_registered("userId") || !session_is_registered("subscriber"))
{
echo("<script language='javascript'>location.href='login.php'</script>");
}
?>

Link to comment
https://forums.phpfreaks.com/topic/175976-solved-session-start-error/
Share on other sites

I would debug the problem.  You are evaluating if they are registered as a UserID or subscriber... I would put an else condition on there for one and see if you can get the else to hit.

 

I would also try setting the session for a longer time interval. I would guess that one of the reasons this error is happening is because the session is timing out. Your clients are probably just walking away from the computer or doing extra stuff and then going back to the site after the session has expired.

I actually just thought of something and can someone tell me if this may be it.

 

This account has 2 domains, 1 of which is parked. When the pay I have them redirected back to domain1.com......would it kill the session if they happen to be on the website domain2.com, paid and were redirected back to domain1.com?

 

 

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.