FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » standard easy way to set up a registration/logon cookie?
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: standard easy way to set up a registration/logon cookie? [message #176345 is a reply to message #176344] Mon, 26 December 2011 17:50 Go to previous messageGo to previous message
houghi is currently offline  houghi
Messages: 45
Registered: September 2011
Karma:
Member
The Natural Philosopher wrote:
> Someone wants to set up a specialist discussion site: I want to keep it
> simple so I don't want to use a pre packaged solution.

Simple in layout? Simple in options? Simple in maintanance? Simple in
coding? Simple for the users?

> Essentially he needs to let users comment on topics, and have some
> control over spam and abuse, hence registration and a name/password combo.

I would go for a pre-packaged solution. That would be simple for the
developer. Just turn off anything you do not want or need. When you
start developing from 0, you will at some point in the future be asked
to add X, Y and Z and then you will notice how you need to start over
again, because that specific task is not possible.

> But given the technical lack of sophistication of the target audience,
> persistent cookies would be a good thing to allow them to stay logged in
> indefinitely (or not if the desire)
>
> I'd like to hand out some random cookie when they register, or log in
> and stick it in the database, together with a time value which, if they
> don't want to 'persist' would be ignored if it was out of date.
>
> Then write a simple PHP module that says 'if the cookie is valid, you
> are Joe Bloggs and you can post away' else if not, throw them into a
> login/registration screen.
>
> Is 'sessions' any real help here? Or is it just easier to set and
> retrieve a cookie at a more basic level?

Session cookies are for, uh, sessions. I would just create a semi-random
cookie that is lined to the user. This can be easily (dfrom the users
point of view) be enabled or disabled with "Please keep me logged in" or
something similar. If this is set, the cookie is set, if not it isn't.

You could even link it to the last time logged in and if it is more then
1 week or 1 month ago, logging in is a must.

You could even do it is ASP as this whole thing has not much to do with
php.

houghi
--
This is written under the inluence of the following:
> Artist : Herbert Grönemeyer
> Song : Mass aller Dinge
> Album : Sprünge
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: cheap, discount nike air max shoes, paypal payment, free shipping
Next Topic: multi-dimensional array sorting by index (like a table)
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Mon Nov 25 23:27:17 GMT 2024

Total time taken to generate the page: 0.05683 seconds