[Skip to main content](#vessel-content)

#   Force a logout out at end of a purchase?

##

- **[webcandy](/forum/user/35060-webcandy "View webcandy's Profile")**
- [![webcandy's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/35060-webcandy "View webcandy's Profile")
- [ Offline](/forum/user/35060-webcandy)

Less More

- Posts: 23
- Thank you received: 2
-
-
-
-

11 years 11 months ago -  11 years 11 months ago [\#180994](#180994) by [webcandy](/forum/user/35060-webcandy "View webcandy's Profile")  Replied by *[webcandy](/forum/user/35060-webcandy "View webcandy's Profile")* on topic *[Force a logout out at end of a purchase?](/forum/33-customers/873174-force-a-logout-out-at-end-of-a-purchase?start=20#180994 "-- HikaShop version -- : 2.3.4 -- Joomla version -- : 3.3.6 -- PHP version -- : 5.4.34  I have a purchase process setup where the user is assigned to a group after the purchase. This group will give them access to multiple things on the site that others will not have.  The process works great, and they are added to that group at the end of the payment. However, the user had to register at the beginning of the process, and that &quot;forces&quot; them to be logged in. So, I believe we have a disconnect here, where they still only have the permissions from the original login applied to the current session. In order to gain access to what the new group provides, the user has to log out.  Can I force a logout at the end of the purchase or some kind of reload so they will then have their new permissions when the payment is complete?")*

YeeP, did you try adding http:// onto the code I posted? Sometimes joomla does that to me if I just do www.

Sorry if I am stating the obvious ![:)](/media/kunena/emoticons/3.png ":)") Try:
Code:

&lt;?php /** * @package HikaShop for Joomla! * @version 2.3.4 * @author hikashop.com * @copyright (C) 2010-2014 HIKARI SOFTWARE. All rights reserved. * @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html */ defined('_JEXEC') or die('Restricted access'); ?&gt;&lt;?php $app = JFactory::getApplication(); $app-&gt;enqueueMessage( JText::_('THANK_YOU_FOR_PURCHASE') ); /* Added custom code below to force a user logout when a purchase is complete. Find problem solving here: http://www.hikashop.com/forum/customers/873174-force-a-logout-out-at-end-of-a-purchase.html */ $app = JFactory::getApplication(); $app-&gt;logout(); header( "Location: http://www.domain.com/redirectpage.php" ); exit; ?&gt;

Last edit: 11 years 11 months ago by [webcandy](/forum/user/35060-webcandy "View webcandy's Profile").

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMzLWN1c3RvbWVycy84NzMxNzQtZm9yY2UtYS1sb2dvdXQtb3V0LWF0LWVuZC1vZi1hLXB1cmNoYXNlP3N0YXJ0PTIwJnRtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[YeeP](/forum/user/33561-yeep "View YeeP's Profile")**
- [![YeeP's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/33561-yeep "View YeeP's Profile") Topic Author
- [ Offline](/forum/user/33561-yeep)

Less More

- Posts: 49
- Thank you received: 1
-
-

11 years 11 months ago -  11 years 11 months ago [\#180995](#180995) by [YeeP](/forum/user/33561-yeep "View YeeP's Profile")  Replied by *[YeeP](/forum/user/33561-yeep "View YeeP's Profile")* on topic *[Force a logout out at end of a purchase?](/forum/33-customers/873174-force-a-logout-out-at-end-of-a-purchase?start=20#180995 "-- HikaShop version -- : 2.3.4 -- Joomla version -- : 3.3.6 -- PHP version -- : 5.4.34  I have a purchase process setup where the user is assigned to a group after the purchase. This group will give them access to multiple things on the site that others will not have.  The process works great, and they are added to that group at the end of the payment. However, the user had to register at the beginning of the process, and that &quot;forces&quot; them to be logged in. So, I believe we have a disconnect here, where they still only have the permissions from the original login applied to the current session. In order to gain access to what the new group provides, the user has to log out.  Can I force a logout at the end of the purchase or some kind of reload so they will then have their new permissions when the payment is complete?")*

Understood. I will try that now. Just FYI, at least I know it is hitting the right processes here, even though the redirect is not working.

If I refresh after the purchase, the phantom cart goes away (CTRL-F5 on my browser before a new purchase and cache dump on the site made no difference to the amount in phantom cart) but I am still at the following url: Code:

https://www.domain.com/index.php?option=com_hikashop&amp;ctrl=checkout&amp;task=after_end&amp;order_id=15

Trying your idea now..

EDIT:
webcandy - just so you know, nicolas never closed the php brackets in that file, even after his recommended change. I am going to remove that line of code to keep it in the same "status" for whatever file it goes to next.

Last edit: 11 years 11 months ago by [YeeP](/forum/user/33561-yeep "View YeeP's Profile").

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMzLWN1c3RvbWVycy84NzMxNzQtZm9yY2UtYS1sb2dvdXQtb3V0LWF0LWVuZC1vZi1hLXB1cmNoYXNlP3N0YXJ0PTIwJnRtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[webcandy](/forum/user/35060-webcandy "View webcandy's Profile")**
- [![webcandy's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/35060-webcandy "View webcandy's Profile")
- [ Offline](/forum/user/35060-webcandy)

Less More

- Posts: 23
- Thank you received: 2
-
-
-
-

11 years 11 months ago -  11 years 11 months ago [\#180997](#180997) by [webcandy](/forum/user/35060-webcandy "View webcandy's Profile")  Replied by *[webcandy](/forum/user/35060-webcandy "View webcandy's Profile")* on topic *[Force a logout out at end of a purchase?](/forum/33-customers/873174-force-a-logout-out-at-end-of-a-purchase?start=20#180997 "-- HikaShop version -- : 2.3.4 -- Joomla version -- : 3.3.6 -- PHP version -- : 5.4.34  I have a purchase process setup where the user is assigned to a group after the purchase. This group will give them access to multiple things on the site that others will not have.  The process works great, and they are added to that group at the end of the payment. However, the user had to register at the beginning of the process, and that &quot;forces&quot; them to be logged in. So, I believe we have a disconnect here, where they still only have the permissions from the original login applied to the current session. In order to gain access to what the new group provides, the user has to log out.  Can I force a logout at the end of the purchase or some kind of reload so they will then have their new permissions when the payment is complete?")*

my "?&gt;" added at the end should take care of that

Last edit: 11 years 11 months ago by [webcandy](/forum/user/35060-webcandy "View webcandy's Profile").

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMzLWN1c3RvbWVycy84NzMxNzQtZm9yY2UtYS1sb2dvdXQtb3V0LWF0LWVuZC1vZi1hLXB1cmNoYXNlP3N0YXJ0PTIwJnRtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[YeeP](/forum/user/33561-yeep "View YeeP's Profile")**
- [![YeeP's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/33561-yeep "View YeeP's Profile") Topic Author
- [ Offline](/forum/user/33561-yeep)

Less More

- Posts: 49
- Thank you received: 1
-
-

11 years 11 months ago [\#180998](#180998) by [YeeP](/forum/user/33561-yeep "View YeeP's Profile")  Replied by *[YeeP](/forum/user/33561-yeep "View YeeP's Profile")* on topic *[Force a logout out at end of a purchase?](/forum/33-customers/873174-force-a-logout-out-at-end-of-a-purchase?start=20#180998 "-- HikaShop version -- : 2.3.4 -- Joomla version -- : 3.3.6 -- PHP version -- : 5.4.34  I have a purchase process setup where the user is assigned to a group after the purchase. This group will give them access to multiple things on the site that others will not have.  The process works great, and they are added to that group at the end of the payment. However, the user had to register at the beginning of the process, and that &quot;forces&quot; them to be logged in. So, I believe we have a disconnect here, where they still only have the permissions from the original login applied to the current session. In order to gain access to what the new group provides, the user has to log out.  Can I force a logout at the end of the purchase or some kind of reload so they will then have their new permissions when the payment is complete?")*

That is what I am saying though. That never existed in the original. It ended in an "open bracket" status.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMzLWN1c3RvbWVycy84NzMxNzQtZm9yY2UtYS1sb2dvdXQtb3V0LWF0LWVuZC1vZi1hLXB1cmNoYXNlP3N0YXJ0PTIwJnRtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[webcandy](/forum/user/35060-webcandy "View webcandy's Profile")**
- [![webcandy's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/35060-webcandy "View webcandy's Profile")
- [ Offline](/forum/user/35060-webcandy)

Less More

- Posts: 23
- Thank you received: 2
-
-
-
-

11 years 11 months ago [\#180999](#180999) by [webcandy](/forum/user/35060-webcandy "View webcandy's Profile")  Replied by *[webcandy](/forum/user/35060-webcandy "View webcandy's Profile")* on topic *[Force a logout out at end of a purchase?](/forum/33-customers/873174-force-a-logout-out-at-end-of-a-purchase?start=20#180999 "-- HikaShop version -- : 2.3.4 -- Joomla version -- : 3.3.6 -- PHP version -- : 5.4.34  I have a purchase process setup where the user is assigned to a group after the purchase. This group will give them access to multiple things on the site that others will not have.  The process works great, and they are added to that group at the end of the payment. However, the user had to register at the beginning of the process, and that &quot;forces&quot; them to be logged in. So, I believe we have a disconnect here, where they still only have the permissions from the original login applied to the current session. In order to gain access to what the new group provides, the user has to log out.  Can I force a logout at the end of the purchase or some kind of reload so they will then have their new permissions when the payment is complete?")*

oh right. I just noticed that. I would just leave it off as you said then.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMzLWN1c3RvbWVycy84NzMxNzQtZm9yY2UtYS1sb2dvdXQtb3V0LWF0LWVuZC1vZi1hLXB1cmNoYXNlP3N0YXJ0PTIwJnRtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[YeeP](/forum/user/33561-yeep "View YeeP's Profile")**
- [![YeeP's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/33561-yeep "View YeeP's Profile") Topic Author
- [ Offline](/forum/user/33561-yeep)

Less More

- Posts: 49
- Thank you received: 1
-
-

11 years 11 months ago [\#181000](#181000) by [YeeP](/forum/user/33561-yeep "View YeeP's Profile")  Replied by *[YeeP](/forum/user/33561-yeep "View YeeP's Profile")* on topic *[Force a logout out at end of a purchase?](/forum/33-customers/873174-force-a-logout-out-at-end-of-a-purchase?start=20#181000 "-- HikaShop version -- : 2.3.4 -- Joomla version -- : 3.3.6 -- PHP version -- : 5.4.34  I have a purchase process setup where the user is assigned to a group after the purchase. This group will give them access to multiple things on the site that others will not have.  The process works great, and they are added to that group at the end of the payment. However, the user had to register at the beginning of the process, and that &quot;forces&quot; them to be logged in. So, I believe we have a disconnect here, where they still only have the permissions from the original login applied to the current session. In order to gain access to what the new group provides, the user has to log out.  Can I force a logout at the end of the purchase or some kind of reload so they will then have their new permissions when the payment is complete?")*

Webcandy-
After entering the card and hitting process, I am immediately sent somewhere where I do not have permission to go to and given a message: "Please login first".

There is only one menu item that is locked down by permissions, unless it tried to redirect to some part of the purchase process. Either way, I did loose the phantom cart, but was redirected somewhere I should not be allowed (according to Joomla!).

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMzLWN1c3RvbWVycy84NzMxNzQtZm9yY2UtYS1sb2dvdXQtb3V0LWF0LWVuZC1vZi1hLXB1cmNoYXNlP3N0YXJ0PTIwJnRtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[webcandy](/forum/user/35060-webcandy "View webcandy's Profile")**
- [![webcandy's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/35060-webcandy "View webcandy's Profile")
- [ Offline](/forum/user/35060-webcandy)

Less More

- Posts: 23
- Thank you received: 2
-
-
-
-

11 years 11 months ago -  11 years 11 months ago [\#181002](#181002) by [webcandy](/forum/user/35060-webcandy "View webcandy's Profile")  Replied by *[webcandy](/forum/user/35060-webcandy "View webcandy's Profile")* on topic *[Force a logout out at end of a purchase?](/forum/33-customers/873174-force-a-logout-out-at-end-of-a-purchase?start=20#181002 "-- HikaShop version -- : 2.3.4 -- Joomla version -- : 3.3.6 -- PHP version -- : 5.4.34  I have a purchase process setup where the user is assigned to a group after the purchase. This group will give them access to multiple things on the site that others will not have.  The process works great, and they are added to that group at the end of the payment. However, the user had to register at the beginning of the process, and that &quot;forces&quot; them to be logged in. So, I believe we have a disconnect here, where they still only have the permissions from the original login applied to the current session. In order to gain access to what the new group provides, the user has to log out.  Can I force a logout at the end of the purchase or some kind of reload so they will then have their new permissions when the payment is complete?")*

What was the redirect URL you used? I know you say only one should be locked down, but It's going to redirect to whatever page you put in the code so I would check the permissions on that first. I would just try having it redirect to your main site for testing purposes. You can share the URL so you can see if I can get to it, if you want.

You can add "sleep(20);" before the header code to delay the redirection so they can see the message. The number is in seconds.

So your code will look like:
Code:

&lt;?php /** * @package HikaShop for Joomla! * @version 2.3.4 * @author hikashop.com * @copyright (C) 2010-2014 HIKARI SOFTWARE. All rights reserved. * @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html */ defined('_JEXEC') or die('Restricted access'); ?&gt;&lt;?php $app = JFactory::getApplication(); $app-&gt;enqueueMessage( JText::_('THANK_YOU_FOR_PURCHASE') ); /* Added custom code below to force a user logout when a purchase is complete. Find problem solving here: http://www.hikashop.com/forum/customers/873174-force-a-logout-out-at-end-of-a-purchase.html */ $app = JFactory::getApplication(); $app-&gt;logout(); sleep(20); header( "Location: http://www.domain.com/redirectpage.php" ); exit;

EDIT: you might have to move around the sleep to get the exact results you want. Not positive.

Last edit: 11 years 11 months ago by [webcandy](/forum/user/35060-webcandy "View webcandy's Profile").

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMzLWN1c3RvbWVycy84NzMxNzQtZm9yY2UtYS1sb2dvdXQtb3V0LWF0LWVuZC1vZi1hLXB1cmNoYXNlP3N0YXJ0PTIwJnRtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[YeeP](/forum/user/33561-yeep "View YeeP's Profile")**
- [![YeeP's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/33561-yeep "View YeeP's Profile") Topic Author
- [ Offline](/forum/user/33561-yeep)

Less More

- Posts: 49
- Thank you received: 1
-
-

11 years 11 months ago -  11 years 11 months ago [\#181004](#181004) by [YeeP](/forum/user/33561-yeep "View YeeP's Profile")  Replied by *[YeeP](/forum/user/33561-yeep "View YeeP's Profile")* on topic *[Force a logout out at end of a purchase?](/forum/33-customers/873174-force-a-logout-out-at-end-of-a-purchase?start=20#181004 "-- HikaShop version -- : 2.3.4 -- Joomla version -- : 3.3.6 -- PHP version -- : 5.4.34  I have a purchase process setup where the user is assigned to a group after the purchase. This group will give them access to multiple things on the site that others will not have.  The process works great, and they are added to that group at the end of the payment. However, the user had to register at the beginning of the process, and that &quot;forces&quot; them to be logged in. So, I believe we have a disconnect here, where they still only have the permissions from the original login applied to the current session. In order to gain access to what the new group provides, the user has to log out.  Can I force a logout at the end of the purchase or some kind of reload so they will then have their new permissions when the payment is complete?")*

Ok, I tried it again after figuring something out on the cart url redirect. I had that set at [ www.domain.com](http://www.domain.com), and if you added something to the cart, then click on the "X" in the header to remove it from the cart, I would redirect to [ www.domain.com/www.domain.com](http://www.domain.com/www.domain.com)

So I changed that redirect to a blank, and tried clicking the X again. No problem, it works fine.

Now, I tried another purchase, and end up back somewhere that I should not be... I guess. Code:

&lt;?php /** * @package HikaShop for Joomla! * @version 2.3.4 * @author hikashop.com * @copyright (C) 2010-2014 HIKARI SOFTWARE. All rights reserved. * @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html */ defined('_JEXEC') or die('Restricted access'); ?&gt;&lt;?php $app = JFactory::getApplication(); $app-&gt;enqueueMessage( JText::_('THANK_YOU_FOR_PURCHASE') ); /* Added custom code below to force a user logout when a purchase is complete. Find problem solving here: http://www.hikashop.com/forum/customers/873174-force-a-logout-out-at-end-of-a-purchase.html */ $app = JFactory::getApplication(); $app-&gt;logout(); header( "Location: http://www.domain.com" ); exit;

One thing here, I am forcing an https using both .htaccess and akeeba admin tool. I really doubt that is having an effect here, because if I just type the address into a browser, it will automatically redirect to an https.

Last edit: 11 years 11 months ago by [YeeP](/forum/user/33561-yeep "View YeeP's Profile").

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMzLWN1c3RvbWVycy84NzMxNzQtZm9yY2UtYS1sb2dvdXQtb3V0LWF0LWVuZC1vZi1hLXB1cmNoYXNlP3N0YXJ0PTIwJnRtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[webcandy](/forum/user/35060-webcandy "View webcandy's Profile")**
- [![webcandy's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/35060-webcandy "View webcandy's Profile")
- [ Offline](/forum/user/35060-webcandy)

Less More

- Posts: 23
- Thank you received: 2
-
-
-
-

11 years 11 months ago [\#181005](#181005) by [webcandy](/forum/user/35060-webcandy "View webcandy's Profile")  Replied by *[webcandy](/forum/user/35060-webcandy "View webcandy's Profile")* on topic *[Force a logout out at end of a purchase?](/forum/33-customers/873174-force-a-logout-out-at-end-of-a-purchase?start=20#181005 "-- HikaShop version -- : 2.3.4 -- Joomla version -- : 3.3.6 -- PHP version -- : 5.4.34  I have a purchase process setup where the user is assigned to a group after the purchase. This group will give them access to multiple things on the site that others will not have.  The process works great, and they are added to that group at the end of the payment. However, the user had to register at the beginning of the process, and that &quot;forces&quot; them to be logged in. So, I believe we have a disconnect here, where they still only have the permissions from the original login applied to the current session. In order to gain access to what the new group provides, the user has to log out.  Can I force a logout at the end of the purchase or some kind of reload so they will then have their new permissions when the payment is complete?")*

What happens after the purchase? The same issue with permissions?

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMzLWN1c3RvbWVycy84NzMxNzQtZm9yY2UtYS1sb2dvdXQtb3V0LWF0LWVuZC1vZi1hLXB1cmNoYXNlP3N0YXJ0PTIwJnRtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[YeeP](/forum/user/33561-yeep "View YeeP's Profile")**
- [![YeeP's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/33561-yeep "View YeeP's Profile") Topic Author
- [ Offline](/forum/user/33561-yeep)

Less More

- Posts: 49
- Thank you received: 1
-
-

11 years 11 months ago [\#181006](#181006) by [YeeP](/forum/user/33561-yeep "View YeeP's Profile")  Replied by *[YeeP](/forum/user/33561-yeep "View YeeP's Profile")* on topic *[Force a logout out at end of a purchase?](/forum/33-customers/873174-force-a-logout-out-at-end-of-a-purchase?start=20#181006 "-- HikaShop version -- : 2.3.4 -- Joomla version -- : 3.3.6 -- PHP version -- : 5.4.34  I have a purchase process setup where the user is assigned to a group after the purchase. This group will give them access to multiple things on the site that others will not have.  The process works great, and they are added to that group at the end of the payment. However, the user had to register at the beginning of the process, and that &quot;forces&quot; them to be logged in. So, I believe we have a disconnect here, where they still only have the permissions from the original login applied to the current session. In order to gain access to what the new group provides, the user has to log out.  Can I force a logout at the end of the purchase or some kind of reload so they will then have their new permissions when the payment is complete?")*

Yes, same as before. I am adding the sleep command right now and trying again just for the heck of it.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMzLWN1c3RvbWVycy84NzMxNzQtZm9yY2UtYS1sb2dvdXQtb3V0LWF0LWVuZC1vZi1hLXB1cmNoYXNlP3N0YXJ0PTIwJnRtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[YeeP](/forum/user/33561-yeep "View YeeP's Profile")**
- [![YeeP's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/33561-yeep "View YeeP's Profile") Topic Author
- [ Offline](/forum/user/33561-yeep)

Less More

- Posts: 49
- Thank you received: 1
-
-

11 years 11 months ago [\#181007](#181007) by [YeeP](/forum/user/33561-yeep "View YeeP's Profile")  Replied by *[YeeP](/forum/user/33561-yeep "View YeeP's Profile")* on topic *[Force a logout out at end of a purchase?](/forum/33-customers/873174-force-a-logout-out-at-end-of-a-purchase?start=20#181007 "-- HikaShop version -- : 2.3.4 -- Joomla version -- : 3.3.6 -- PHP version -- : 5.4.34  I have a purchase process setup where the user is assigned to a group after the purchase. This group will give them access to multiple things on the site that others will not have.  The process works great, and they are added to that group at the end of the payment. However, the user had to register at the beginning of the process, and that &quot;forces&quot; them to be logged in. So, I believe we have a disconnect here, where they still only have the permissions from the original login applied to the current session. In order to gain access to what the new group provides, the user has to log out.  Can I force a logout at the end of the purchase or some kind of reload so they will then have their new permissions when the payment is complete?")*

Webcandy - I think something is doing a redirect on this site and I cannot find it. Possibly permissions on the site?

It wants me to log in no matter what now, like even when I go to the site, not logged in. That could be a cause of this, but I have no idea what is doing it.

That was not happening this morning and I have no idea what change did it.... lovely.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMzLWN1c3RvbWVycy84NzMxNzQtZm9yY2UtYS1sb2dvdXQtb3V0LWF0LWVuZC1vZi1hLXB1cmNoYXNlP3N0YXJ0PTIwJnRtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[webcandy](/forum/user/35060-webcandy "View webcandy's Profile")**
- [![webcandy's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/35060-webcandy "View webcandy's Profile")
- [ Offline](/forum/user/35060-webcandy)

Less More

- Posts: 23
- Thank you received: 2
-
-
-
-

11 years 11 months ago [\#181008](#181008) by [webcandy](/forum/user/35060-webcandy "View webcandy's Profile")  Replied by *[webcandy](/forum/user/35060-webcandy "View webcandy's Profile")* on topic *[Force a logout out at end of a purchase?](/forum/33-customers/873174-force-a-logout-out-at-end-of-a-purchase?start=20#181008 "-- HikaShop version -- : 2.3.4 -- Joomla version -- : 3.3.6 -- PHP version -- : 5.4.34  I have a purchase process setup where the user is assigned to a group after the purchase. This group will give them access to multiple things on the site that others will not have.  The process works great, and they are added to that group at the end of the payment. However, the user had to register at the beginning of the process, and that &quot;forces&quot; them to be logged in. So, I believe we have a disconnect here, where they still only have the permissions from the original login applied to the current session. In order to gain access to what the new group provides, the user has to log out.  Can I force a logout at the end of the purchase or some kind of reload so they will then have their new permissions when the payment is complete?")*

I don't know why it'd be hika. Check out your modules associated to menus...check out your HikaShop Cart Module and make sure the access is public...and any other things you can think of.

That sucks a lot and I hope it's not hikashop related ![:(](/media/kunena/emoticons/22.png ":(")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMzLWN1c3RvbWVycy84NzMxNzQtZm9yY2UtYS1sb2dvdXQtb3V0LWF0LWVuZC1vZi1hLXB1cmNoYXNlP3N0YXJ0PTIwJnRtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[YeeP](/forum/user/33561-yeep "View YeeP's Profile")**
- [![YeeP's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/33561-yeep "View YeeP's Profile") Topic Author
- [ Offline](/forum/user/33561-yeep)

Less More

- Posts: 49
- Thank you received: 1
-
-

11 years 11 months ago -  11 years 11 months ago [\#181009](#181009) by [YeeP](/forum/user/33561-yeep "View YeeP's Profile")  Replied by *[YeeP](/forum/user/33561-yeep "View YeeP's Profile")* on topic *[Force a logout out at end of a purchase?](/forum/33-customers/873174-force-a-logout-out-at-end-of-a-purchase?start=20#181009 "-- HikaShop version -- : 2.3.4 -- Joomla version -- : 3.3.6 -- PHP version -- : 5.4.34  I have a purchase process setup where the user is assigned to a group after the purchase. This group will give them access to multiple things on the site that others will not have.  The process works great, and they are added to that group at the end of the payment. However, the user had to register at the beginning of the process, and that &quot;forces&quot; them to be logged in. So, I believe we have a disconnect here, where they still only have the permissions from the original login applied to the current session. In order to gain access to what the new group provides, the user has to log out.  Can I force a logout at the end of the purchase or some kind of reload so they will then have their new permissions when the payment is complete?")*

Ya, it really does suck... Right now, if you try to just go to: Code:

www.domain.com

you end up at: Code:

www.domain.com/component/users/?view=login

I just changed the permissions

EDIT: If i hit the HOME button on the menu, I a redirected to the alias: [ www.domain.com/home](http://www.domain.com/home) and am not requested to log in.

reconfigured the way the url is printed in the browser to try and find cause. I don't think this is any help but... Code:

www.domain.com/index.php?option=com_users&amp;view=login

EDIT 2 - I am going to use the "sledgehammer" method here and backup the site. I will uninstall components one by one to see if I can get to the regular domain address. Then reload the backup after I find the culprit.

Last edit: 11 years 11 months ago by [YeeP](/forum/user/33561-yeep "View YeeP's Profile").

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMzLWN1c3RvbWVycy84NzMxNzQtZm9yY2UtYS1sb2dvdXQtb3V0LWF0LWVuZC1vZi1hLXB1cmNoYXNlP3N0YXJ0PTIwJnRtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86564
- Thank you received: 14311
-
-

11 years 11 months ago [\#181023](#181023) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Force a logout out at end of a purchase?](/forum/33-customers/873174-force-a-logout-out-at-end-of-a-purchase?start=20#181023 "-- HikaShop version -- : 2.3.4 -- Joomla version -- : 3.3.6 -- PHP version -- : 5.4.34  I have a purchase process setup where the user is assigned to a group after the purchase. This group will give them access to multiple things on the site that others will not have.  The process works great, and they are added to that group at the end of the payment. However, the user had to register at the beginning of the process, and that &quot;forces&quot; them to be logged in. So, I believe we have a disconnect here, where they still only have the permissions from the original login applied to the current session. In order to gain access to what the new group provides, the user has to log out.  Can I force a logout at the end of the purchase or some kind of reload so they will then have their new permissions when the payment is complete?")*

Hi,

If you enter a URL in the "return URL" parameter of your payment method, the default thank you page of HikaShop is not used and instead HikaShop redirects you to that return URL.
So I would recommend to check on that.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMzLWN1c3RvbWVycy84NzMxNzQtZm9yY2UtYS1sb2dvdXQtb3V0LWF0LWVuZC1vZi1hLXB1cmNoYXNlP3N0YXJ0PTIwJnRtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[YeeP](/forum/user/33561-yeep "View YeeP's Profile")**
- [![YeeP's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/33561-yeep "View YeeP's Profile") Topic Author
- [ Offline](/forum/user/33561-yeep)

Less More

- Posts: 49
- Thank you received: 1
-
-

11 years 11 months ago [\#181025](#181025) by [YeeP](/forum/user/33561-yeep "View YeeP's Profile")  Replied by *[YeeP](/forum/user/33561-yeep "View YeeP's Profile")* on topic *[Force a logout out at end of a purchase?](/forum/33-customers/873174-force-a-logout-out-at-end-of-a-purchase?start=20#181025 "-- HikaShop version -- : 2.3.4 -- Joomla version -- : 3.3.6 -- PHP version -- : 5.4.34  I have a purchase process setup where the user is assigned to a group after the purchase. This group will give them access to multiple things on the site that others will not have.  The process works great, and they are added to that group at the end of the payment. However, the user had to register at the beginning of the process, and that &quot;forces&quot; them to be logged in. So, I believe we have a disconnect here, where they still only have the permissions from the original login applied to the current session. In order to gain access to what the new group provides, the user has to log out.  Can I force a logout at the end of the purchase or some kind of reload so they will then have their new permissions when the payment is complete?")*

Good shot Nicolas, but there is nothing in that field right now. Any other ideas?

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMzLWN1c3RvbWVycy84NzMxNzQtZm9yY2UtYS1sb2dvdXQtb3V0LWF0LWVuZC1vZi1hLXB1cmNoYXNlP3N0YXJ0PTIwJnRtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[webcandy](/forum/user/35060-webcandy "View webcandy's Profile")**
- [![webcandy's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/35060-webcandy "View webcandy's Profile")
- [ Offline](/forum/user/35060-webcandy)

Less More

- Posts: 23
- Thank you received: 2
-
-
-
-

11 years 11 months ago [\#181031](#181031) by [webcandy](/forum/user/35060-webcandy "View webcandy's Profile")  Replied by *[webcandy](/forum/user/35060-webcandy "View webcandy's Profile")* on topic *[Force a logout out at end of a purchase?](/forum/33-customers/873174-force-a-logout-out-at-end-of-a-purchase?start=20#181031 "-- HikaShop version -- : 2.3.4 -- Joomla version -- : 3.3.6 -- PHP version -- : 5.4.34  I have a purchase process setup where the user is assigned to a group after the purchase. This group will give them access to multiple things on the site that others will not have.  The process works great, and they are added to that group at the end of the payment. However, the user had to register at the beginning of the process, and that &quot;forces&quot; them to be logged in. So, I believe we have a disconnect here, where they still only have the permissions from the original login applied to the current session. In order to gain access to what the new group provides, the user has to log out.  Can I force a logout at the end of the purchase or some kind of reload so they will then have their new permissions when the payment is complete?")*

just so I understand, are you being redirected to that crazy page even when you just type in the domain name in your address bar?

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMzLWN1c3RvbWVycy84NzMxNzQtZm9yY2UtYS1sb2dvdXQtb3V0LWF0LWVuZC1vZi1hLXB1cmNoYXNlP3N0YXJ0PTIwJnRtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[YeeP](/forum/user/33561-yeep "View YeeP's Profile")**
- [![YeeP's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/33561-yeep "View YeeP's Profile") Topic Author
- [ Offline](/forum/user/33561-yeep)

Less More

- Posts: 49
- Thank you received: 1
-
-

11 years 11 months ago [\#181032](#181032) by [YeeP](/forum/user/33561-yeep "View YeeP's Profile")  Replied by *[YeeP](/forum/user/33561-yeep "View YeeP's Profile")* on topic *[Force a logout out at end of a purchase?](/forum/33-customers/873174-force-a-logout-out-at-end-of-a-purchase?start=20#181032 "-- HikaShop version -- : 2.3.4 -- Joomla version -- : 3.3.6 -- PHP version -- : 5.4.34  I have a purchase process setup where the user is assigned to a group after the purchase. This group will give them access to multiple things on the site that others will not have.  The process works great, and they are added to that group at the end of the payment. However, the user had to register at the beginning of the process, and that &quot;forces&quot; them to be logged in. So, I believe we have a disconnect here, where they still only have the permissions from the original login applied to the current session. In order to gain access to what the new group provides, the user has to log out.  Can I force a logout at the end of the purchase or some kind of reload so they will then have their new permissions when the payment is complete?")*

You are correct. However, I fixed that and can now return to the standard domain address without being forced to a login. I will now test the sleep idea you had, as that is when I found this other issue (I think I found the issue because your idea worked). I won't be in front of my computer for a couple of hours, but will report back. Thanks for your help.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMzLWN1c3RvbWVycy84NzMxNzQtZm9yY2UtYS1sb2dvdXQtb3V0LWF0LWVuZC1vZi1hLXB1cmNoYXNlP3N0YXJ0PTIwJnRtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[webcandy](/forum/user/35060-webcandy "View webcandy's Profile")**
- [![webcandy's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/35060-webcandy "View webcandy's Profile")
- [ Offline](/forum/user/35060-webcandy)

Less More

- Posts: 23
- Thank you received: 2
-
-
-
-

11 years 11 months ago [\#181033](#181033) by [webcandy](/forum/user/35060-webcandy "View webcandy's Profile")  Replied by *[webcandy](/forum/user/35060-webcandy "View webcandy's Profile")* on topic *[Force a logout out at end of a purchase?](/forum/33-customers/873174-force-a-logout-out-at-end-of-a-purchase?start=20#181033 "-- HikaShop version -- : 2.3.4 -- Joomla version -- : 3.3.6 -- PHP version -- : 5.4.34  I have a purchase process setup where the user is assigned to a group after the purchase. This group will give them access to multiple things on the site that others will not have.  The process works great, and they are added to that group at the end of the payment. However, the user had to register at the beginning of the process, and that &quot;forces&quot; them to be logged in. So, I believe we have a disconnect here, where they still only have the permissions from the original login applied to the current session. In order to gain access to what the new group provides, the user has to log out.  Can I force a logout at the end of the purchase or some kind of reload so they will then have their new permissions when the payment is complete?")*

Glad to hear it! I hope that is the case. Make sure to use sleep in conjuction wit the redirect like I have up there. Good luck!

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMzLWN1c3RvbWVycy84NzMxNzQtZm9yY2UtYS1sb2dvdXQtb3V0LWF0LWVuZC1vZi1hLXB1cmNoYXNlP3N0YXJ0PTIwJnRtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[YeeP](/forum/user/33561-yeep "View YeeP's Profile")**
- [![YeeP's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/33561-yeep "View YeeP's Profile") Topic Author
- [ Offline](/forum/user/33561-yeep)

Less More

- Posts: 49
- Thank you received: 1
-
-

11 years 11 months ago -  11 years 11 months ago [\#181150](#181150) by [YeeP](/forum/user/33561-yeep "View YeeP's Profile")  Replied by *[YeeP](/forum/user/33561-yeep "View YeeP's Profile")* on topic *[Force a logout out at end of a purchase?](/forum/33-customers/873174-force-a-logout-out-at-end-of-a-purchase?start=20#181150 "-- HikaShop version -- : 2.3.4 -- Joomla version -- : 3.3.6 -- PHP version -- : 5.4.34  I have a purchase process setup where the user is assigned to a group after the purchase. This group will give them access to multiple things on the site that others will not have.  The process works great, and they are added to that group at the end of the payment. However, the user had to register at the beginning of the process, and that &quot;forces&quot; them to be logged in. So, I believe we have a disconnect here, where they still only have the permissions from the original login applied to the current session. In order to gain access to what the new group provides, the user has to log out.  Can I force a logout at the end of the purchase or some kind of reload so they will then have their new permissions when the payment is complete?")*

Webcandy- after three tests this morning, I can say that we are close, but not there yet.

**Test 1**Code:

&lt;?php /** * @package HikaShop for Joomla! * @version 2.3.4 * @author hikashop.com * @copyright (C) 2010-2014 HIKARI SOFTWARE. All rights reserved. * @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html */ defined('_JEXEC') or die('Restricted access'); ?&gt;&lt;?php $app = JFactory::getApplication(); $app-&gt;enqueueMessage( JText::_('THANK_YOU_FOR_PURCHASE') ); /* Added custom code below to force a user logout when a purchase is complete. Find problem solving here: http://www.hikashop.com/forum/customers/873174-force-a-logout-out-at-end-of-a-purchase.html */ $app = JFactory::getApplication(); $app-&gt;logout(); /* sleep(8); header( "Location: http://www.domain.com/" ); exit;*/

**Result:** End up back with phantom cart, still logged in. I tried commenting out your code in hopes that the other issue I was having was the cause of that problem. Turns out it was not.

**Test 2**Code:

&lt;?php /** * @package HikaShop for Joomla! * @version 2.3.4 * @author hikashop.com * @copyright (C) 2010-2014 HIKARI SOFTWARE. All rights reserved. * @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html */ defined('_JEXEC') or die('Restricted access'); ?&gt;&lt;?php $app = JFactory::getApplication(); $app-&gt;enqueueMessage( JText::_('THANK_YOU_FOR_PURCHASE') ); /* Added custom code below to force a user logout when a purchase is complete. Find problem solving here: http://www.hikashop.com/forum/customers/873174-force-a-logout-out-at-end-of-a-purchase.html */ $app = JFactory::getApplication(); $app-&gt;logout(); sleep(8); header( "Location: http://www.domain.com/" ); exit;

**Result:** I never see the "Thank you for purchase" message. It looks to "process" with a blank page after the purchase, then it loads on to the home page with no message, logged out.

Nicolas, I really appreciate all the help webcandy and you are giving me, but I am starting to feel like this is something the software should do. At least, based on your first repose to this and the following suggestions related to settings in Joomla and Hikashop. All of which I have already had set to your recommendations. I am literally at a standstill and cannot test the clients real bank money transfers. I can type fake credit card numbers in all day, but this is a serious problem now.

I am happy to admit if I made a mistake, and I think I have shown that. Please help in any way you have the time to.

Last edit: 11 years 11 months ago by [YeeP](/forum/user/33561-yeep "View YeeP's Profile").

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMzLWN1c3RvbWVycy84NzMxNzQtZm9yY2UtYS1sb2dvdXQtb3V0LWF0LWVuZC1vZi1hLXB1cmNoYXNlP3N0YXJ0PTIwJnRtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[YeeP](/forum/user/33561-yeep "View YeeP's Profile")**
- [![YeeP's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/33561-yeep "View YeeP's Profile") Topic Author
- [ Offline](/forum/user/33561-yeep)

Less More

- Posts: 49
- Thank you received: 1
-
-

11 years 11 months ago [\#181156](#181156) by [YeeP](/forum/user/33561-yeep "View YeeP's Profile")  Replied by *[YeeP](/forum/user/33561-yeep "View YeeP's Profile")* on topic *[Force a logout out at end of a purchase?](/forum/33-customers/873174-force-a-logout-out-at-end-of-a-purchase?start=20#181156 "-- HikaShop version -- : 2.3.4 -- Joomla version -- : 3.3.6 -- PHP version -- : 5.4.34  I have a purchase process setup where the user is assigned to a group after the purchase. This group will give them access to multiple things on the site that others will not have.  The process works great, and they are added to that group at the end of the payment. However, the user had to register at the beginning of the process, and that &quot;forces&quot; them to be logged in. So, I believe we have a disconnect here, where they still only have the permissions from the original login applied to the current session. In order to gain access to what the new group provides, the user has to log out.  Can I force a logout at the end of the purchase or some kind of reload so they will then have their new permissions when the payment is complete?")*

Just tried a run with the "exit;" statement removed. This made no difference to the above "Test 2". It just processes aka sleeps for the amount of time assigned, then pops to the main home page.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMzLWN1c3RvbWVycy84NzMxNzQtZm9yY2UtYS1sb2dvdXQtb3V0LWF0LWVuZC1vZi1hLXB1cmNoYXNlP3N0YXJ0PTIwJnRtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

Board Categories HikaShop Install &amp; Update Product &amp; Category Display Content Creation Sales and Orders Orders management Reports &amp; Statistics Customers Checkout Payment Methods Shipping Methods Import &amp; Export (CSV, XLS…) Specific Features Affilation Taxes Wishlist Vote Carousel &amp; Slider Mass Actions Filters &amp; Search Discount &amp; Coupon Feature Request Integrations Showcase General Talk about HikaShop Development HikaShop 3.0 Beta Translation Commercial Jobs HikaShop Components HikaMarket Market: Feature requests Market: How to? Market: Bug Report HikaSerial General talk about HikaSerial Serial: Bug Report Serial: How to? Support en Français de HikaSerial (French Support) HikaSubscription HikaAuction Auction: Feature requests Auction: How to? Auction: Bug report Hikashop around the world Support en Français (French Support) Russian FAQ. Курс выживания с Hikashop. Частые вопросы и о Расширения Hikashop Наши сайты на Hikashop 日本語版サポート(Japanese Support) Thai German Archives Bug Report How to?

[](/forum/topics/feed/mode-topics?format=feed&type=rss)

Time to create page: 0.120 seconds

[Powered by](/forum/credits) [Kunena Forum](https://www.kunena.org)
