[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 [\#181254](#181254) 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=60#181254 "-- 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?")*

> korzo wrote:
> Although your code will work in this particular situation, there are several downsides:
> $user-&gt;groups has only groups assigned to user, not inherited groups.
> header() will fail, if some output was already sent and also it doesn't pass queued messages to next page.

That is good info. Thank you!

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMzLWN1c3RvbWVycy84NzMxNzQtZm9yY2UtYS1sb2dvdXQtb3V0LWF0LWVuZC1vZi1hLXB1cmNoYXNlP3N0YXJ0PTYwJnRtcGw9bWFya2Rvd24=) 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 [\#181358](#181358) 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=60#181358 "-- 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?")*

Nice work korzo! I now get over to the Membership area and get the expected pop up message for the new user(that part was already working). I think I will tweak the message so the Day 1 piece doesn't cover it when they first get here, but I can handle that.
[ ![korozo&#95;message.png](/forum/attachment/20924) ](/forum/attachment/20924 "...zo&#95;message.png")

Thank you so much for your help. I am really curious as to why you could not duplicate. I wonder if whatever is causing this on my side is the reason that I could not the the system to work the way it was supposed to in the first place.

If you have any ideas, I am all ears.

Thanks again!
Ryan

- [ ![korozo&#95;message.png](/forum/attachment/20924) ](/forum/attachment/20924 "...zo&#95;message.png") [ ](/forum/attachment/20924?download=1 "...zo&#95;message.png")

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

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMzLWN1c3RvbWVycy84NzMxNzQtZm9yY2UtYS1sb2dvdXQtb3V0LWF0LWVuZC1vZi1hLXB1cmNoYXNlP3N0YXJ0PTYwJnRtcGw9bWFya2Rvd24=) 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.053 seconds

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