473,395 Members | 1,530 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

basic global.asa thingy

Hello

I have login-page where i set the column LoggedIn = 'Y' when a user logs
in, i was wondering if you guys could help me set up my global.asa so
correctly so it sets LoggedIn='N' when Session("UserID") times out.

what is needed besides:
set conn=server.createobject("adodb.connection")
conn.open connstr
sql="update users set loggedin='N' where userid="&session("userid")
conn.execute(sql)
set conn=nothing

?

do i need to set something up in the IIS too or?

TIA
/Lasse
Jul 19 '05 #1
2 1944
On Wed, 5 Nov 2003 13:58:54 +0100, "Lasse Edsvik" <la***@nospam.com>
wrote:
Hello

I have login-page where i set the column LoggedIn = 'Y' when a user logs
in, i was wondering if you guys could help me set up my global.asa so
correctly so it sets LoggedIn='N' when Session("UserID") times out.

what is needed besides:
set conn=server.createobject("adodb.connection")
conn.open connstr
sql="update users set loggedin='N' where userid="&session("userid")
conn.execute(sql)
set conn=nothing


This is not going to work for you. Two of many reasons are:

1. By your specification, the SQL statement defined will run when the
session times out. Therefore, the "userid" value in the session
collection will not exist, so you dont know who to log out.

2. The code you specify runs on the server. If a user simply leaves
their browser open without activity, or closes it, the server gets no
trigger to run the code. Session timeout does not occur as a trigger
on the server.
Jul 19 '05 #2
Instead of using this method, what about setting a session variable (say
session("LoggedIn")) when the user logs in, then you can check for this in
your code to ensure the user is still logged in....

if isLoggedIn then
'yep, the user is still logged in
end if

function isLoggedIn
if len(session("LoggedIn")) > 0 then
isLoggedIn = True
else
isLoggedIn = False
end if
end function

If you have a manual logout, then you can set session("LoggedIn") = "" when
the user logs out.
"Lasse Edsvik" <la***@nospam.com> wrote in message
news:#b**************@TK2MSFTNGP09.phx.gbl...
Hello

I have login-page where i set the column LoggedIn = 'Y' when a user logs
in, i was wondering if you guys could help me set up my global.asa so
correctly so it sets LoggedIn='N' when Session("UserID") times out.

what is needed besides:
set conn=server.createobject("adodb.connection")
conn.open connstr
sql="update users set loggedin='N' where userid="&session("userid")
conn.execute(sql)
set conn=nothing

?

do i need to set something up in the IIS too or?

TIA
/Lasse

Jul 19 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Phil Powell | last post by:
/*-------------------------------------------------------------------------------------------- This function will utilize the ability to use HTTP-based WWW Authentication, checking for the global...
4
by: Ramesh | last post by:
hi, Let me ask some basic questions. Can anybody explain me about the following questions: 1. When we have to create sn key? Whenever we compiled Component we have to create or it is a one time...
4
by: Alex Maghen | last post by:
This is weird On my WinXP development box, database calls made from within my GLOBAL.ASAX go to SQLServer as user "ASPNET" even though I have impersonation turned on in my web.config. That's fine...
0
by: Andy | last post by:
Hey All, I'm a beginner with VB.Dotnet Deployment and I'm a little confused about some very basic deployment issues . . . I've now created some core assemblies that will be used throughout all...
4
by: Mark Linehan | last post by:
Greetings and salutations. I began programming God knows how many years ago in basic on the Commodore 64. I dabbled in a little assembly as well. I moved on to the PC eventually and stuck with...
0
by: Dr. Zharkov | last post by:
Hello. To see the graphics of technology DirectX 9.0 SDK Update - June 2005 in project Visual Basic, WindowsApplication1 from Visual Studio 2005 Beta 1, in file My Project, MyApplication.vb in a...
6
by: Vivek | last post by:
Hi, I have created a list<t> for my form that displays data in a listview. I wixh to edit the row with the help of another form and then update the list<t>. How do I declare a global list that...
1
by: steve | last post by:
A series of articles examining some basic concepts in Sql Server. Basic Anatomy of Sql Server, part I What is a stored procedure?...
14
by: MartinRinehart | last post by:
Working on parser for my language, I see that all classes (Token, Production, Statement, ...) have one thing in common. They all maintain start and stop positions in the source text. So it seems...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.