﻿<?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 » Role Based Security  » How to know is logged in?</title><generator>InstantForum 2017-1 Final</generator><description>StrataFrame Forum</description><link>http://forum.strataframe.net/</link><webMaster>StrataFrame Forum</webMaster><lastBuildDate>Tue, 09 Jun 2026 03:12:09 GMT</lastBuildDate><ttl>20</ttl><item><title>How to know is logged in?</title><link>http://forum.strataframe.net/FindPost20856.aspx</link><description>Hi,&lt;br&gt;
How could I know if user has logged in system in Web environment?&lt;br&gt;
&lt;br&gt;
Thank you</description><pubDate>Sat, 29 Nov 2008 03:45:22 GMT</pubDate><dc:creator>Chan</dc:creator></item><item><title>RE: How to know is logged in?</title><link>http://forum.strataframe.net/FindPost20922.aspx</link><description>[quote]Hello guys,&lt;br&gt;
I think that Chan means finding a way to know if a user is already logged in into the web application. I´m pretty sure that there´s a post in here asking this functionality but in windows environment and the answer was to handle this flag using an extra table. I´ll try to find that post.[/quote]&lt;br&gt;
&lt;br&gt;
Hi,&lt;br&gt;
Yes, it is what I meant.&lt;br&gt;
However, use table for this purpose might not accurate as well. It need extra afford to maintain the table.&lt;br&gt;
I was thinking just to check if Session[SecurityBasics.CurrentUserWebSessionVariable] != null to determine it. Do you think it is fine?&lt;br&gt;
&lt;br&gt;
Thank you</description><pubDate>Sat, 29 Nov 2008 03:45:22 GMT</pubDate><dc:creator>Chan</dc:creator></item><item><title>RE: How to know is logged in?</title><link>http://forum.strataframe.net/FindPost20921.aspx</link><description>Ok there it is:&lt;br&gt;
&lt;br&gt;
[url=http://forum.strataframe.net/Topic4402-21-1.aspx][/url]</description><pubDate>Sat, 29 Nov 2008 02:47:13 GMT</pubDate><dc:creator>Guillermo Vilas</dc:creator></item><item><title>RE: How to know is logged in?</title><link>http://forum.strataframe.net/FindPost20920.aspx</link><description>Hello guys,&lt;br&gt;
I think that Chan means finding a way to know if a user is already logged in into the web application. I´m pretty sure that there´s a post in here asking this functionality but in windows environment and the answer was to handle this flag using an extra table. I´ll try to find that post. :cool:</description><pubDate>Sat, 29 Nov 2008 02:42:43 GMT</pubDate><dc:creator>Guillermo Vilas</dc:creator></item><item><title>RE: How to know is logged in?</title><link>http://forum.strataframe.net/FindPost20918.aspx</link><description>Hi Chan,&lt;/P&gt;&lt;P&gt;In Page_Load I check for the permissions of the user (if the user is a "client")&lt;/P&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;&lt;P&gt;if&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#000000 size=2&gt; (&lt;/FONT&gt;&lt;FONT color=#2b91af size=2&gt;&lt;FONT color=#2b91af size=2&gt;SecurityBasics&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#000000 size=2&gt;.CurrentUser.GetPermission(&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;&lt;FONT color=#a31515 size=2&gt;"client"&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#000000 size=2&gt;).Action != &lt;/FONT&gt;&lt;FONT color=#2b91af size=2&gt;&lt;FONT color=#2b91af size=2&gt;PermissionAction&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#000000 size=2&gt;.Grant&amp;nbsp; &lt;/FONT&gt;&lt;FONT size=2&gt;&lt;FONT color=#000000&gt;)&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;Response.Redirect(&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;&lt;FONT color=#a31515 size=2&gt;"default.aspx"&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;);&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;/FONT&gt;</description><pubDate>Fri, 28 Nov 2008 15:09:19 GMT</pubDate><dc:creator>Hugo R. Figueroa</dc:creator></item><item><title>RE: How to know is logged in?</title><link>http://forum.strataframe.net/FindPost20913.aspx</link><description>Hi,&lt;br&gt;
May I know how to do it?&lt;br&gt;
I still unable to figure out.&lt;br&gt;
&lt;br&gt;
Thank you</description><pubDate>Thu, 27 Nov 2008 09:29:08 GMT</pubDate><dc:creator>Chan</dc:creator></item><item><title>RE: How to know is logged in?</title><link>http://forum.strataframe.net/FindPost20894.aspx</link><description>Hi,&lt;br&gt;
Yeah. I have set SecurityBasics.IsWebEnvironment = True. However, I still don't know how to determine whether user has already log in to system or he/she just try to access page via direct url.</description><pubDate>Tue, 25 Nov 2008 09:32:49 GMT</pubDate><dc:creator>Chan</dc:creator></item><item><title>RE: How to know is logged in?</title><link>http://forum.strataframe.net/FindPost20892.aspx</link><description>This is described in the help docs. As the snippet that Ivan posted points out, you use the&amp;nbsp;SecurityBasics.CurrentUser property to get the currently logged in user. When operating in a web environment, you will need to make a configuration change so that the CurrentUser property will function correctly.&amp;nbsp; This configuration change is outlined in the &lt;EM&gt;Required Global.asax Code&lt;/EM&gt; topic.&lt;/P&gt;&lt;P&gt;The pertinent instructions from that help topic are pasted below:&lt;/P&gt;&lt;H2&gt;IsWebEnvironment&lt;/H2&gt;&lt;P&gt;The &lt;SPAN class=fth&gt;MicroFour.StrataFrame.Security.SecurityBasics&lt;/SPAN&gt; class contains the shared (static) property &lt;SPAN class=fth&gt;IsWebEnvironment&lt;/SPAN&gt;.&amp;nbsp; This property is used to indicate to the security module that the security is being run from within a web application and that the session objects should be used to store the &lt;SPAN class=fth&gt;CurrentUser&lt;/SPAN&gt; and other session specific data. The &lt;SPAN class=fth&gt;IsWebEnvironment&lt;/SPAN&gt; property should be set at the top of the &lt;SPAN class=fth&gt;Application_Start()&lt;/SPAN&gt; method within the Global.asax file.&lt;/P&gt;&lt;DIV class=CodeHeader&gt;Sample - Setting the IsWebEnvironment Property [Visual Basic]&lt;/DIV&gt;&lt;DIV class=Code_VisualBasic&gt;&lt;PRE&gt;[codesnippet]Imports MicroFour.StrataFrame.Security&lt;BR&gt;...&lt;BR&gt;Protected Sub Application_Start(ByVal sender As Object, ByVal e As EventArgs)&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; '-- Set the property&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; SecurityBasics.IsWebEnvironment = True&lt;BR&gt;End Sub[/codesnippet]&lt;/PRE&gt;&lt;/DIV&gt;&lt;P&gt;&lt;BR&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV class=CodeHeader&gt;Sample - Setting the IsWebEnvironment Property [C#]&lt;/DIV&gt;&lt;DIV class=Code_CSharp&gt;&lt;PRE&gt;[codesnippet]using MicroFour.StrataFrame.Security;&lt;BR&gt;...&lt;BR&gt;protected void Application_Start(object sender, EventArgs e)&lt;BR&gt;{&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; //-- Set the property&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; SecurityBasics.IsWebEnvironment = true;&lt;BR&gt;}[/codesnippet]&lt;/PRE&gt;&lt;/DIV&gt;</description><pubDate>Tue, 25 Nov 2008 09:04:49 GMT</pubDate><dc:creator>Dustin Taylor</dc:creator></item><item><title>RE: How to know is logged in?</title><link>http://forum.strataframe.net/FindPost20884.aspx</link><description>Hi,&lt;br&gt;
Huh? do you meant I got to check Session in order to know if is logged in?&lt;br&gt;</description><pubDate>Mon, 24 Nov 2008 21:39:59 GMT</pubDate><dc:creator>Chan</dc:creator></item><item><title>RE: How to know is logged in?</title><link>http://forum.strataframe.net/FindPost20860.aspx</link><description>&lt;H1&gt;CurrentUser Overview&lt;/H1&gt;&lt;P&gt;The MicroFour.StrataFrame.Security.SecurityBasics.CurrentUser property contains an object reference to the currently logged on user for the application. This property defaults to an instance of the MicroFour.StrataFrame.Security.AdminUser class so that all permissions will be granted unless the CurrentUser is set to another object. This default functionality provides support for the application framework when security is not being used by the application.&lt;/P&gt;&lt;P&gt;The SecurityBasics.CurrentUser property returns an object reference that implements the MicroFour.StrataFrame.Security.ISecurityUser interface. This interface describes methods and properties that can be used to access:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;User's primary key (UserID or UserPK) &lt;LI&gt;User's login name &lt;LI&gt;User's login time &lt;LI&gt;User's session lockout time &lt;LI&gt;User's permissions&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;For more information on accessing the current user’s permissions, see &lt;A style="auto-update-caption: true" href="ms-its:C:\Program Files\MicroFour\StrataFrame\Documentation\SecurityHelp.chm::/AccessingPermissionsProgrammatically.html"&gt;Accessing Permissions Programmatically&lt;/A&gt;, and for more information on accessing the user’s properties, see &lt;A style="auto-update-caption: true" href="ms-its:C:\Program Files\MicroFour\StrataFrame\Documentation\SecurityHelp.chm::/AccessingCurrentUserInformation.html"&gt;Accessing CurrentUser Information&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;The classes within the StrataFrame application framework and the StrataFrame security module that implement the ISecurityUser interface are:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;SPAN class=BlueHighlight&gt;AdminUser&lt;/SPAN&gt; - When the built-in administrator credentials are used to log into the application. &lt;LI&gt;&lt;SPAN class=BlueHighlight&gt;SecurityMaintenanceUser&lt;/SPAN&gt; - When the built-in security maintenance credentials were used to log into the application. &lt;LI&gt;&lt;SPAN class=BlueHighlight&gt;LoggedInUser&lt;/SPAN&gt; - When a standard user’s credentials were used to log into the application.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;--------------------------------------------------------------------------------------------&lt;/P&gt;&lt;H1&gt;Differences in Web Security&lt;/H1&gt;&lt;P&gt;Security within a web project is different than security within a Windows project in the following ways:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;SPAN class=BlueHighlight&gt;CurrentUser&lt;/SPAN&gt; - &lt;SPAN class=fth&gt;SecurityBasics.CurrentUser&lt;/SPAN&gt; must be configured to store an &lt;SPAN class=fth&gt;ISecurityUser&lt;/SPAN&gt; object for each session. &lt;LI&gt;&lt;SPAN class=BlueHighlight&gt;Maintenance Forms&lt;/SPAN&gt; - To maintain users, roles, and restriction sets, you must either create custom web-based maintenance forms or use the winform-based maintenance forms provided. &lt;LI&gt;&lt;SPAN class=BlueHighlight&gt;Object Permissions&lt;/SPAN&gt; - Object permission function much the same as when using winforms, with the primary exception being the lack of form-level security keys. &lt;LI&gt;&lt;SPAN class=BlueHighlight&gt;Session Locking&lt;/SPAN&gt; - Session locking is not supported within web applications. &lt;LI&gt;&lt;SPAN class=BlueHighlight&gt;Programmatic Access&lt;/SPAN&gt; - Programmatic access within a web project is exactly the same as within a Windows project.&lt;/LI&gt;&lt;/UL&gt;&lt;H2&gt;CurrentUser&lt;/H2&gt;&lt;P&gt;When using security on the web, the &lt;SPAN class=fth&gt;SecurityBasics.CurrentUser&lt;/SPAN&gt; property must be&amp;nbsp;configured to store a different &lt;SPAN class=fth&gt;ISecurityUser&lt;/SPAN&gt; object for each session, rather than just one for the whole AppDomain.&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is accomplished via&amp;nbsp;a configuration setting which indicates that the application is being run within a web environment.&amp;nbsp; This tells the &lt;SPAN class=fth&gt;CurrentUser&lt;/SPAN&gt; property to use the current session object to retrieve and store the current &lt;SPAN class=fth&gt;ISecurityUser&lt;/SPAN&gt;.&amp;nbsp; For more information, refer to the &lt;A style="auto-update-caption: true" href="ms-its:C:\Program Files\MicroFour\StrataFrame\Documentation\SecurityHelp.chm::/RequiredGlobalasaxCode.html"&gt;Required Global.asax Code&lt;/A&gt; topic.</description><pubDate>Mon, 24 Nov 2008 05:12:27 GMT</pubDate><dc:creator>Ivan George Borges</dc:creator></item></channel></rss>