﻿<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>StrataFrame Forum » StrataFrame Application Framework - V1 » WinForms (How do I?)  » Logout old user ... Login new user</title><generator>InstantForum 2017-1 Final</generator><description>StrataFrame Forum</description><link>http://forum.strataframe.net/</link><webMaster>StrataFrame Forum</webMaster><lastBuildDate>Mon, 08 Jun 2026 23:45:47 GMT</lastBuildDate><ttl>20</ttl><item><title>Logout old user ... Login new user</title><link>http://forum.strataframe.net/FindPost33286.aspx</link><description>I've read the thread concerning this but it didn't quite sink in.&lt;br/&gt;&lt;br/&gt;&lt;div&gt;All I need to do is that after I call SessionLoc.LockSession() and my custom login form appears:&lt;br/&gt;&lt;br/&gt;&lt;div&gt;1. I need the previously logged in user to be logged out&lt;div&gt;2. The exit button enabled&lt;div&gt;3. If a new login occurs, log in the new user.&lt;br/&gt;&lt;br/&gt;&lt;div&gt;Currently, when the next user attempts to login, regardless of credentials, if the credentials are met then the application becomes active again ... with the old user still logged in. &amp;nbsp;I see the value in this assuming a user simply wants to lock their application and then return to it later. &amp;nbsp;But I want the whole login process to occur again and the Security object to reflect the newly logged in user.&lt;br/&gt;&lt;br/&gt;&lt;div&gt;Should be easy I just don't know how to make it happen.&lt;br/&gt;&lt;br/&gt;&lt;div&gt;Thanks,</description><pubDate>Wed, 02 Mar 2016 10:00:00 GMT</pubDate><dc:creator>Charles Thomas Blankenship</dc:creator></item><item><title>RE: Logout old user ... Login new user</title><link>http://forum.strataframe.net/FindPost33289.aspx</link><description>Thanks a bunch guys ... I'll keep you posted as to the outcome.</description><pubDate>Wed, 02 Mar 2016 10:00:00 GMT</pubDate><dc:creator>Charles Thomas Blankenship</dc:creator></item><item><title>RE: Logout old user ... Login new user</title><link>http://forum.strataframe.net/FindPost33288.aspx</link><description>Hi All,&lt;br/&gt;I do the same as Ivan.&lt;br/&gt;If in any case you may have your own table to show users currently logged into the application, then you will have to update your table yourself in the same process.&lt;br/&gt;&lt;br/&gt;AFAIK, StrataFrame does not keep any record of the previous logged user.</description><pubDate>Tue, 01 Mar 2016 09:05:44 GMT</pubDate><dc:creator>Edhy Rijo</dc:creator></item><item><title>RE: Logout old user ... Login new user</title><link>http://forum.strataframe.net/FindPost33287.aspx</link><description>Hi Charles.&lt;br/&gt;&lt;br/&gt;&lt;div&gt;I cannot reproduce the fact that a new user will log in and the session will be still running under the old user credentials after that. Whenever a different user logs in after a Session Lock, this user will be the current user from then on. If the old user left a form open which the new user has no permission to see it, right after the new login that form will automatically receive a panel to cover all its controls and the new logged in user won't have access to it.&amp;nbsp;&lt;br/&gt;&lt;br/&gt;&lt;div&gt;Now, if you, for example, like I do in my application, have menu items that should be Enabled/Disabled depending on the current user permissions, you will have to refresh those statuses by yourself. In my situation, I have added a handler for the AfterSessionLock into my MainForm, like this:&lt;br/&gt;&lt;br/&gt;&lt;div&gt;&lt;pre style="font-family:Consolas;font-size:13;color:black;background:white;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color:green;"&gt;'--&amp;nbsp;Add&amp;nbsp;handler&amp;nbsp;to&amp;nbsp;refresh&amp;nbsp;Menus&amp;nbsp;after&amp;nbsp;Session&amp;nbsp;Lock&amp;nbsp;&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/pre&gt;&lt;pre style="font-family:Consolas;font-size:13;color:black;background:white;"&gt;&lt;span style="color:blue;"&gt;        AddHandler&lt;/span&gt;&amp;nbsp;MicroFour.StrataFrame.Security.&lt;span style="color:#2b91af;"&gt;SessionLock&lt;/span&gt;.AfterSessionLock,&amp;nbsp;&lt;span style="color:blue;"&gt;AddressOf&lt;/span&gt;&amp;nbsp;HandleAfterSessionLock&lt;/pre&gt;&lt;br/&gt;&lt;br/&gt;&lt;div&gt;This way, I can then add any code needed to refresh the new situation:&lt;br/&gt;&lt;br/&gt;&lt;div&gt;&lt;pre style="font-family:Consolas;font-size:13;color:black;background:white;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color:blue;"&gt;Public&lt;/span&gt;&amp;nbsp;&lt;span style="color:blue;"&gt;Sub&lt;/span&gt;&amp;nbsp;HandleAfterSessionLock(&lt;span style="color:blue;"&gt;ByVal&lt;/span&gt;&amp;nbsp;sender&amp;nbsp;&lt;span style="color:blue;"&gt;As&lt;/span&gt;&amp;nbsp;&lt;span style="color:blue;"&gt;Object&lt;/span&gt;,&amp;nbsp;&lt;span style="color:blue;"&gt;ByVal&lt;/span&gt;&amp;nbsp;e&amp;nbsp;&lt;span style="color:blue;"&gt;As&lt;/span&gt;&amp;nbsp;&lt;span style="color:#2b91af;"&gt;EventArgs&lt;/span&gt;)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/pre&gt;&lt;pre style="font-family:Consolas;font-size:13;color:black;background:white;"&gt;&lt;span style="color:green;"&gt;       '--&amp;nbsp;add&amp;nbsp;code to deal with new user logged in&lt;/span&gt;&lt;/pre&gt;&lt;div&gt;&lt;pre style="font-family:Consolas;font-size:13;color:black;background:white;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color:blue;"&gt;End&lt;/span&gt;&amp;nbsp;&lt;span style="color:blue;"&gt;Sub&lt;/span&gt;&lt;/pre&gt;&lt;br/&gt;&lt;br/&gt;&lt;div&gt;Hope it helps.&lt;br/&gt;&lt;br/&gt;&lt;div&gt;Ivan&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;</description><pubDate>Tue, 01 Mar 2016 04:30:49 GMT</pubDate><dc:creator>Ivan George Borges</dc:creator></item></channel></rss>