Posted by Mike on 10/10/89 11:39
I'm developing a site that a user registers, logs in and for some
pages, has to subscribe.
Basically, the user registers and then when they log in I set a session
say AUTH=yes.
Then every page the user goes to I can check the AUTH session and if
yes then display the page else request a login.
Now I will have a flag in the database that when a user subscribes the
field PAID=yes.
What would be the best way to check the user has paid at the top of
every page that requires a subscription.
I have thought of 2..
1) When the user logs in and the AUTH=yes is set, the database is also
checked for the PAID field and if PAID=yes then set a session say
USERHASPAID=yes. Then on ever page required I just check the session
USERHASPAID.
2) When the user logs in and AUTH=yes is set, the users unique id is
also stored to a session. Then on every page requiring subscription
the database is searched for the users unique id and PAID=yes.
I know they both will work but I was just wondering which would be the
prefered method.
Thanks
Mike
[Back to original message]
|