Every membership site has to answer one question on every page in the members area: is this visitor a paying member? How that question is answered depends on how the site was built and which billing processor it uses. Some sites rely on a password-protected folder managed by the processor, others on a members script that keeps a login session, and some on a cookie or a custom check written years ago.
When you add anything new to a members area, whether a content system, a new gallery page or a statistics tool, it needs to fit in with the login you already have. Asking members to log in a second time is a quick way to generate support emails. This guide explains the common login methods, how safe each one is, and what to consider when connecting new tools to them.
Password-protected folders
The longest-standing method is a password-protected folder. The web server itself guards a folder, often /members/, and asks for a username and password before showing anything inside it. Billing processors such as CCBill, Epoch, Segpay and Verotel, and affiliate and membership tools such as NATS, commonly add and remove members from that folder's password list automatically as they join and leave. Sites that take payments through PayPal or many other processors usually rely on a members script and a session login instead.
The strength of this method is that the check happens before any of your pages run. A visitor who is not on the list never reaches the content at all, and after a successful login the web server tells your scripts which username was used. The main drawback is the plain browser login box, which looks dated, but for protection it is hard to beat.
PHP sessions
Many members scripts use their own login form. When a member signs in, the script stores who they are in a PHP session on the server and gives the browser a session cookie that points to it. On every page, the script looks up the session to see whether the visitor is logged in.
Because the member's details live on the server and the cookie only holds a random reference, sessions are safe as long as they are set up sensibly: served over HTTPS, expired after a period of inactivity and cleared on logout. Any new tool on the same site can read the same session, so members stay signed in across old and new pages.
Cookies, server variables and custom checks
Some sites use other signals:
- A plain cookie. The site sets a cookie containing a username or member code. This is easy to read, but a cookie is stored in the visitor's browser and can be edited or copied. On its own it should not be trusted to protect content.
- A server variable. Some setups pass the member's identity in a variable set by the web server, a proxy or a header. How trustworthy this is depends entirely on the setup, and values that come from request headers can be faked.
- A custom check. A short piece of PHP calls your existing members script and asks it whether the visitor is logged in. Because it runs on the server and uses your real login system, this can be just as safe as a session.
Comparing the options
| Method | Where the check happens | Safe to protect content on its own? |
|---|---|---|
| Password-protected folder | Web server, before any page runs | Yes |
| PHP session | Server, using session data | Yes, if set up sensibly |
| Custom function | Server, in your own code | Yes, if it calls a real login check |
| Cookie | Browser-stored value | No, use for recognition only |
| Server variable or header | Depends on setup | Not as the only protection |
A sensible rule is that recognising a member and protecting content are two different jobs. A cookie can be fine for remembering who someone is, for example to count them in statistics, but the actual barrier in front of your content should be a folder, a session or a server-side check.
Respecting member privacy
When a new tool needs to know who is viewing, it does not usually need the member's real username. A one-way code made from the username on the website is enough to tell members apart, count unique visitors and spot popular content, without ever sending names to another system. That keeps the number of places holding member details to a minimum, which is good practice and makes privacy questions much simpler to answer. Our guide to members area statistics worth tracking covers what you can learn this way.
How Members CMS handles this
With Members CMS, members log in exactly as before. For each website you choose how the connector recognises the member:
- a password-protected folder, as used by billing processors such as CCBill, Epoch, Segpay, Verotel and NATS;
- a PHP session, as used by members scripts that take payments through PayPal and many other processors;
- a cookie;
- a server variable;
- a custom function;
- or none.
The "Require login" option is only available with the folder, session or custom methods, the three that can be trusted as protection. Usernames never reach Members CMS; members are counted by a one-way code made on the website. Member accounts, sign-ups and billing stay with your billing processor or members script. The connector's self-check page confirms the login is being recognised, and our guide to connecting your membership sites to one central library walks through the rest of the setup.
Frequently asked questions
Do members need a new login for the content system?
No. Members keep logging in the way they always have. The connector simply recognises who is logged in from the method you choose for that site.
Which login methods are safest?
A password-protected folder, a PHP session or a custom server-side check. Cookies and request headers can be faked, so they should not be the only thing protecting content.
Are member usernames shared with the content system?
They don't need to be. Members CMS only receives a one-way code made on the website, so usernames never leave the site.
