Re: Track user usage, session tracking or cookies?



I use sessions to manage users once they log in. Here is an article
about managing users with mysql and sessions:
http://www.sitepoint.com/article/users-php-sessions-mysql

Once a user logs in, declare a session:

session_start();

Declare a session variable saying that the person is logged in:

$_SESSION['login'] = true;

When a user tries to get to a user-only page, check the session
variable to see if the person is a logged-in registered user:

if ($_SESSION['login'] == true)
{
Let user request the page;
}
else
{
Send user to the registration page;
}

Nick Mudge
www.democranet.com

.



Relevant Pages

  • Re: print problem with multiuser
    ... It's possible the printers weren't removed correctly and when the new user logs in with the same session id that the orignial user had, they also picked up the printers. ... Microsoft MVP - Terminal Server ...
    (microsoft.public.windows.terminal_services)
  • Re: Problem in service with User Fast-Switching
    ... That session ID is which triggered the session change event. ... A user logs off then logs on previously unopened account ... A user logs off then logs previously opened account ...
    (microsoft.public.win32.programmer.kernel)
  • Re: ASP.NET Forms Authentication - How to Know if User Has Previously Been Authenticated
    ... the user logs on to my site and checks "Remember my ... ID" (persistent cookie). ... logged in" because their FormsAuthentication ticket was set to ... Request.IsAuthenticated = false when they open the new session. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: server question
    ... >> values when a user logs in. ... And after that uses http to show the pages. ... Since I am using session var's to keep track of things, ... store the session id in a secure cookie, then it wouldn't be sent when the ...
    (comp.lang.php)
  • Re: Slow Logon 2003 TS
    ... something when the user logs on or off. ... lock ups and total freezing of their session. ... I have no idea where to start troubleshooting such a situation. ...
    (microsoft.public.windows.terminal_services)