https://www.icyphoenix.com/viewtopic.php?f=35&t=8875&p=58043#p58043
-----------------------------------
mort
Thu 17 Jan, 2013 08:28

Re: How Do I Check If A User Is Logged In ?
-----------------------------------
Not IP - - :P

But as an example.

You query the DB for the information.

[code linenumbers=false]	$row = $db->fetch_row($sql);
	if($row['activation_key'] == "0"){
	$_SESSION['username'] = $username;
	$_SESSION['userid'] = $row['userid'];
	$_SESSION['website'] = $row['website'];
	$_SESSION['blog_level'] = $row['blog_level'];
	$_SESSION['lang'] = $row['user_lang'];
	$_SESSION['user_flag'] = $row['user_flag'];
	$_SESSION['user_style'] = $row['user_style'];
	$_SESSION['user_session_time'] = $row['user_session_time'];[/code]

Then start the session in a "Global" file by adding:

[code linenumbers=false]	session_start();[/code]

At the top of the file.

[code linenumbers=false]$user->session_begin();[/code]

Would be a function that collects all the users data. If they are logged in.?

That too - would need to be at the top of every file the user has access to.

Because if it's not S_LOGGED_IN or S_LOGGED-OUT Means nothing.  :mricy:


