Detecting logged in users....

Snitz™ Forums 2000
https://forum.snitz.com/forumTopic/Posts/69877?pagenum=1
05 November 2025, 13:06

Topic


bobby131313
Detecting logged in users....
28 March 2011, 14:55


Has anyone ever put together a "bare minimum" file that could be included on non-forum pages just to detect if the visitor is a logged in forum member? Just enough to check mlev I suppose?

 

Replies ...


ruirib
28 March 2011, 15:19


I use this in a real website:

Code:

<!--#INCLUDE FILE="config.asp"-->
<!--#INCLUDE FILE="inc_sha256.asp"-->
<!--#INCLUDE FILE="inc_func_common.asp"-->


'Get the MemberID from the forum login

set my_Conn = Server.CreateObject("ADODB.Connection")

my_Conn.Open strConnString


'copying stuff from inc_header.asp...
strDBNTUserName = Request.Cookies(strUniqueID & "User")("Name")

if trim(strDBNTUserName) <> "" and trim(Request.Cookies(strUniqueID & "User")("Pword")) <> "" then
mLev = cLng(chkUser(strDBNTUserName, Request.Cookies(strUniqueID & "User")("Pword"),-1))
else
MemberID = -1
mLev = 0
end If

my_conn.Close
Set my_conn = Nothing

You will need cookies set to forum for this to work. You may also have to add the forum path to the includes.
bobby131313
28 March 2011, 17:26


Thanks Rui, I will give it a go this week.
ruirib
28 March 2011, 17:34


Let me know if you have any issues.
bobby131313
15 August 2011, 12:27


Well, months and months later I've finally gotten around to testing this and it works like a charm. Thanks Rui. smile
ruirib
15 August 2011, 12:50


Cool. You're welcome smile.
© 2000-2021 Snitz™ Communications