Visual Studio .NET - can I tell how is currently logged into my web app?

Asked By Paddy Mac
27-Nov-06 06:05 AM

Hi,

Is it possible to tell what users are currently logged into my web app? From time-to-time I the web app may need upgrades, so I want to find out if any users are logged in before I upload.

I'm using forms authenication with SQL Server 2000.

Can this be done? and if so how would I do it?

Thanks,

Paddy

try this!  try this!

27-Nov-06 06:39 AM

I am not sure whether we have any direct method for finding the users who are logged in,

since you have mentioned that using forms authentication, you would have mentioned the list of
users who will be using your application in web.config file, typically your web.config will look like this,

<configuration>
    <system.web>
        <customErrors mode="Off"/>
        <authentication mode="Forms">
            <forms name="appNameAuth" path="/" loginUrl="login.aspx" protection="All" timeout="30">
                <credentials passwordFormat="Clear">
                    <user name="jeff" password="test" />
                    <user name="mike" password="test" />
                </credentials>
            </forms>
        </authentication>
        <authorization>
            <deny users="?" />
        </authorization>
    </system.web>
</configuration>


since you have these user details in place, you maintain this information in a table with a switch saying Current logged in?(yes/no) , whenever a person logins your application, change the database switch to yes and whenever he logsoff update to no, so pick up all 'yes' and u will know who are all logged in!

i found this article about forms authentication , you can also look into this, it doesnt talk about the above db logic, but its good! http://www.15seconds.com/issue/020220.htm

count the number of current users / sessions  count the number of current users / sessions

27-Nov-06 06:53 AM

hello

check here

There are a few ways you can approach this. One is to track users using global.asa and an application variable: 
 

<script language=vbScript runat=server> 
 
sub session_onStart() 
 
    application.lock() 
    application("SCount") = application("SCount") + 1 
    application.unlock() 
 
end sub 
 
sub session_onEnd() 
 
    application.lock() 
    application("SCount") = application("SCount") - 1 
    application.unlock() 
 
end sub 
 
sub application_onStart() 
 
    ' don't need a lock in onStart() 
    application("SCount") = 0 
 
end sub 
 
</script>
 
Then, in any page: 
 
<% 
    Response.Write "Current session count: " & _ 
        application("SCount") 
%>

http://classicasp.aspfaq.com/general/how-do-i-count-the-number-of-current-users/sessions.html

There is nothing   There is nothing "stored" in your application

27-Nov-06 12:12 PM

that tells you whether a user is "logged in". When a user requests a page, their Forms Ticket (cookie) is transmitted with the request, and the Application_AuthenticateRequest method is fired.  Aside from using some sort of  "counting code" like Kevin suggested, this is your only other place that you can set up some sort of persistent mechanism (application state) to tell you that a user is , erm, "logged in".

 

Thanks guys  Thanks guys
29-Nov-06 04:19 AM
cheers for the info guys!
Create New Account
help
Frequently asked Interview Questions in ADO.Net hi friends Any one send frequently asked Important questions in C# .Net, ADO .Net, Asp .Net and Sql Server. . . . . . . . tx in Advance. . . . . . Hi, Find this. . (B)What is an IL? (B)What is a B) What is concept of Boxing and Unboxing ? (B) What is the difference between VB.NET and C#? (I) what is the difference between System exceptions and Application exceptions? (I)What is CODE Access security? (I)What is a satellite assembly? (A) How
Interview Questions for .NET Framework This article is specially for the users those are in development or want to be a .net developer • To test a Web Service you must create a windows application or web application to consume this service? It is True / False? FALSE How many classes can a single NET DLL contain? Answer1: As many Answer2: One or more What are good ADO.NET object(s) to replace the ADO Recordset object? The differences includes In ADO, the in-memory representation of data is the recordset. In ADO.net, it is the dataset A recordset looks like a single table in ADO In contrast a dataset is a collection of one or more tables in ADO.net ADO is designed primarily for connected access ADO.net the disconnected access to the database
Build Procedures in .NET 1.1 Best Practice I am looking for articles that outline the best practices for Deploying .NET 1.1 web applications. I can not upgrade the application at this time to a better .NET framework. Command line codes, tricks to not deploying code files, modification of the web.config per environment etc. . I need to clean up some very old procedures and lock up our deployment procedures. Also our current source control is Rational Clear Case. Which does so all code has to be checked out manually. Follow these steps to deploy your .NET Framework 1.1 application to your production server. Step 1 : Copy your application’s executable files and web pages to your production server
SQL Server Reporting Services SQL Server Reporting Services - Lessons Learned In Development and Deployment By Bill Jones, Jr. Printer Friendly Version we have already learned. We walk through creating a report from the Reporting Services sample database to provide a framework for sharing what has been learned. We make liberal use of who follows will have to learn these items for themselves. Common Reporting Services Deployment Diagram SQL Server 2000 Reporting Services relies on several major components to function correctly. This diagram shows the interrelation
VSS and TFS Tell me some major and valuable differences between VSS (Visual Source Safe) and TFS(Team Foundation Server) as I am going to introduce TFS in my Company. Note: I am going to use any of them for the same purpose (To safe source centralized.) Visual SourceSafe and Team Foundation version control enable you to accomplish the same basic tasks: • Develop into another The Team Foundation version control client interfaces were designed to be familiar to Visual SourceSafe users. Both products offer a command-line client and Microsoft Visual Studio Team System integration. Team Foundation version control does not have a separate user interface like Visual SourceSafe. But despite many similarities, Team Foundation and Visual SourceSafe differ in fundamental ways. This topic is divided into two main sections which expand