# closeSolution doesn't logout the user?

**URL:** https://forum.servoy.com/t/closesolution-doesnt-logout-the-user/7826
**Category:** Classic Servoy
**Created:** [July 16, 2007, 11:39am UTC](https://forum.servoy.com/t/closesolution-doesnt-logout-the-user/7826 "2007-07-16T11:39:04Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![patrick](https://avatars.discourse-cdn.com/v4/letter/p/b2d939/32.png) [@patrick](https://forum.servoy.com/u/patrick)
#### Post date: [July 16, 2007, 11:39am UTC](https://forum.servoy.com/t/closesolution-doesnt-logout-the-user/7826/1 "2007-07-16T11:39:04Z")

</div>

Hello,

to switch users we are currently using application.closeSolution(‘mySolution’). This closes the solution and re-opens it. The problem is, that security.login always returns false in our login method. I suspect it is because the user has not been logged out by closeSolution?

Is this a bug or do I miss something?

Thanks  
Patrick

---

<div class="post-metadata">

### Author: ![Harjo](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.servoy.com/harjo/32/4873_2.png) [@Harjo](https://forum.servoy.com/u/Harjo)
#### Post date: [July 16, 2007, 12:37pm UTC](https://forum.servoy.com/t/closesolution-doesnt-logout-the-user/7826/2 "2007-07-16T12:37:41Z")

</div>

No, a user is still logged-in also between solutions!  
if you really want the user to logout use this:

```auto
security.logout()
application.closeSolution()

```

---

<div class="post-metadata">

### Author: ![patrick](https://avatars.discourse-cdn.com/v4/letter/p/b2d939/32.png) [@patrick](https://forum.servoy.com/u/patrick)
#### Post date: [July 16, 2007, 12:47pm UTC](https://forum.servoy.com/t/closesolution-doesnt-logout-the-user/7826/3 "2007-07-16T12:47:47Z")

</div>

OK. That’s what I thought. Now the issue is that I want to re-open the original solution and not show the solution dialog. That can be done with closeSolution(solutionToOpen), but not with security.logout(). So it seems I can either logout the user and show the solution dialog or do not logout the user but reload the solution right. That’s unpleasant.

What’d be nice then is either

- optional parameter for closeSolution that logs out the user
- optional parameter for logout that allows to pass a solution to load afterwards

---

<div class="post-metadata">

### Author: ![Harjo](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.servoy.com/harjo/32/4873_2.png) [@Harjo](https://forum.servoy.com/u/Harjo)
#### Post date: [July 16, 2007, 12:52pm UTC](https://forum.servoy.com/t/closesolution-doesnt-logout-the-user/7826/4 "2007-07-16T12:52:38Z")

</div>

No, you can simply do this:

```auto
security.logout()
application.closeSolution('openYourSolution')

```

works great for me.

---

<div class="post-metadata">

### Author: ![patrick](https://avatars.discourse-cdn.com/v4/letter/p/b2d939/32.png) [@patrick](https://forum.servoy.com/u/patrick)
#### Post date: [July 16, 2007, 12:55pm UTC](https://forum.servoy.com/t/closesolution-doesnt-logout-the-user/7826/5 "2007-07-16T12:55:56Z")

</div>

Everything OK. To do both works as you suggested

security.logout()  
application.closeSolution()

I thought this wouldn’t work, because logout already closes the solution. But it seems that using both works fine.
