Zen Cart Logo
Forums / Upgrading to 1.5.x / set_session_login=true

set_session_login=true

Views: 871

Results 1 to 3 of 3
30 Jan 2013, 3:05 AM
#1
rweeks avatar

rweeks

New Zenner

Join Date:
Jul 2008
Location:
San Diego, CA
Posts:
45
Plugin Contributions:
0

set_session_login=true

After login the page redirects to: index.php?main_page=index&set_session_login=true

If I log out and click on Login then the page redirects as expected to the product page.
However, if Logout and then click on the home page (which goes to the login page) if goes to set_session_login=true.

Customer Shop status is set to 1 (from another posting I found, this seems to matter) and is a requirement for this store.

There is only 1 product per Customer Price Group. So, all customers in group 1 will see product A, those in Group 2 will see product B, etc.

Accomplished this in includes/modules/pages/login/header_php.php

$path = "index&cPath=".$_SESSION['customers_group_pricing'];
          zen_redirect(zen_href_link( $path, '', $request_type));

When the customer logs in, they need to be directed to the product. Is there a way to correct/work around the page going to set_session_login=true?

Appreciate any help or insight anyone can provide.

30 Jan 2013, 3:49 AM
#2
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
177

Re: set_session_login=true

The redirect you're observing with set_session_login only happens with Customer Shop Status set to 1 as you said you've done. That behavior is normal and expected, and has existed for a long time ... (at least since v1.3.0). And the subsequent redirect back to the page the customer came from is also intended behavior.

What you're describing goes further than that where you're specifically trying to intercept and override that normal behavior and instead redirect them to a specific category, rather than taking them back to the page they came from.

The normal behavior of taking them back to the page they came from is a result of the system setting a snapshot of the page they were on before taking them to the login page, and then the login/header_php reads that snapshot and sends them back to that previous page. So apparently your custom code isn't firing before the snapshot redirect fires. ... ie you've put it too late in the code.

31 Jan 2013, 10:35 PM
#3
rweeks avatar

rweeks

New Zenner

Join Date:
Jul 2008
Location:
San Diego, CA
Posts:
45
Plugin Contributions:
0

Re: set_session_login=true

Thanks for the great explanation. Really appreciate the help. :D
Yes, I now see (and understand better) the if statement in the header_php.php file that redirects to the snapshot.

Another workaround (just for those that might find this in later searches):
I've set Customer Shop status to 2.
Since I have multiple categories, but only allow access to the appropriate category per the customers assigned Price Group, the browsing has been restricted by checking if Price Group is set (modified product_listing.php). If a customer is not logged in, then the price group is not set and the categories can't be browsed. End results seems to be suitable. Testing continues, but this appears to be working.