SitePoint Sponsor

User Tag List

Results 1 to 15 of 15
  1. #1
    SitePoint Addict Ghz's Avatar
    Join Date
    Jun 2002
    Posts
    284
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question Can this be..!!!

    Hi there,
    Can we make the setcookie() time unlimited so that it lasts forever???? if yes, then how?

  2. #2
    SitePoint Addict delpino's Avatar
    Join Date
    Nov 2001
    Location
    London
    Posts
    335
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    as far as i know there is a time limit, but you could try to set it again every time the user visits your site and thus extend the time.
    Last edited by delpino; Oct 10, 2002 at 13:07.
    http://www.antosch-and-lin.com - Language Learning

  3. #3
    SitePoint Addict Ghz's Avatar
    Join Date
    Jun 2002
    Posts
    284
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Aha good idea delpino but this won't work since I want to prevent this visitor / user from registering in my forums again if he or she did it once.

  4. #4
    SitePoint Addict chiefmonkey's Avatar
    Join Date
    Aug 2002
    Posts
    207
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally posted by Ghz
    Aha good idea delpino but this won't work since I want to prevent this visitor / user from registering in my forums again if he or she did it once.
    You can use the mktime() function in the lifetime argument of the cookie, and then set it for alomst unreachable date

    mktime(21,00,0,12,31,2004)

    would set the cookie to expire at 9pm on the 31st December 2004


    George

  5. #5
    SitePoint Guru enygmadae's Avatar
    Join Date
    Sep 2002
    Location
    Dallas, Tx.
    Posts
    795
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    or, you could do it like normal people and just check if they try to register again against a list of usernames already taken and dont allow it.
    PHP News, Views and Community: http://www.phpdeveloper.org

  6. #6
    SitePoint Addict chiefmonkey's Avatar
    Join Date
    Aug 2002
    Posts
    207
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally posted by enygmadae
    or, you could do it like normal people and just check if they try to register again against a list of usernames already taken and dont allow it.
    Can't argue with that, although I took it to mean that they wished to prevent them re-registering as another user.


    George
    Got Sig!

  7. #7
    Fully Qualified Fool :) luke-innovative's Avatar
    Join Date
    Jun 2002
    Location
    Kent, UK
    Posts
    256
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Aha good idea delpino but this won't work since I want to prevent this visitor / user from registering in my forums again if he or she did it once.
    ...And cookies can be deleted quite easily
    Luke
    Luke-Martin.com (work in progress) :: Independent Web Designer's Portal
    Freelance Forums :: Sign Up Here
    "What happens if you get scared half to death twice?"

  8. #8
    SitePoint Addict delpino's Avatar
    Join Date
    Nov 2001
    Location
    London
    Posts
    335
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    then check for the uniqueness of the email address when they sign up.. that should do the trick

    if you want to prevent that by cookie, what if 2 people who work on the same user what to have a separate account?
    Last edited by delpino; Oct 10, 2002 at 13:08.
    http://www.antosch-and-lin.com - Language Learning

  9. #9
    SitePoint Wizard silver trophy someonewhois's Avatar
    Join Date
    Jan 2002
    Location
    Canada
    Posts
    6,364
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally posted by chiefmonkey


    You can use the mktime() function in the lifetime argument of the cookie, and then set it for alomst unreachable date

    mktime(21,00,0,12,31,2004)

    would set the cookie to expire at 9pm on the 31st December 2004


    George
    Sorry, but I failt o see hwo this is "unreachable".

    December 31st, 2004 will come eventualy... or do they have to be active right at 9:00 PM? I didn't think so, but I could be wrong.

    A truly unreachable date:

    PHP Code:
       mktime(21,00,0,12,31,3004); 
    Now if your script is still running in 3004, I'll be amazed Besides, cookies will have been deleted by then anyways (Either by the user, or completly wiped off the face of the net )

  10. #10
    SitePoint Wizard silver trophy someonewhois's Avatar
    Join Date
    Jan 2002
    Location
    Canada
    Posts
    6,364
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Also, for matching:

    Username's would never get duplicated, rarely. Generally the idea is to prevent people from signing up at like 10 different accounts. If they wanted to do this, they'd obviously signup with different usernames. E-mail is useless too, people will change it to some old@email.com address.

    One of the best: Record IP in the user table, and e-mail, and username. Check to see if any one of them have been used.

    A ligitiment (sorry, can't spell) user will see this about the e-mail and username, and will just login.

    Somebody who knows about hte username, and e-mail, will bypass those, but the IP should catch them.


    Now don't get at me that I'm stupid, I know.. IP's change when you disconnect and reconnect (for most people anyways). This simply prevents people from signing up right after the previous one: Who would go through the trouble to disconnect/reconnect just to signup again?
    And the real user accidentally trying to re-signup, won't be able to with same IP, username, OR e-mail

    Just me 2 cents..

    Regards,
    Someonewhois

  11. #11
    SitePoint Addict chiefmonkey's Avatar
    Join Date
    Aug 2002
    Posts
    207
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally posted by someonewhois


    Sorry, but I failt o see hwo this is "unreachable".

    December 31st, 2004 will come eventualy... or do they have to be active right at 9:00 PM? I didn't think so, but I could be wrong.

    A truly unreachable date:

    PHP Code:
       mktime(21,00,0,12,31,3004); 
    Now if your script is still running in 3004, I'll be amazed Besides, cookies will have been deleted by then anyways (Either by the user, or completly wiped off the face of the net )
    I think it must just be me then, I don't think my machine would last over 2 years without needing reformated at some point

    George
    Got Sig!

  12. #12
    SitePoint Wizard silver trophy someonewhois's Avatar
    Join Date
    Jan 2002
    Location
    Canada
    Posts
    6,364
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Oh, well..... then the word "unreachable" isn't really suitable for this situation

  13. #13
    killall -9 lusers
    Join Date
    Oct 2002
    Location
    Cincinnati, Ohio, USA
    Posts
    390
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally posted by chiefmonkey


    I think it must just be me then, I don't think my machine would last over 2 years without needing reformated at some point

    George
    Try Linux. . .

  14. #14
    gingham dress, army boots... silver trophy redux's Avatar
    Join Date
    Apr 2002
    Location
    Salford / Manchester / UK
    Posts
    4,838
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally posted by someonewhois

    One of the best: Record IP in the user table, and e-mail, and username. Check to see if any one of them have been used.
    again, this will not work if two different people use the same machine that has a fixed IP address...
    or, for instance, if they all come through a certain ISP's proxy - as their IP, as your site sees it, is the IP of the proxy, not the user's machine...(as far as i know anyway)

    i think it's worth checking email address...anything beyond that really is a waste of time - imho - as there is NO secure way (unless we start using unique user tracking ... now, where's Palladium, TCPA and co. when you need them ) to do it.
    re·dux (adj.): brought back; returned. used postpositively
    [latin : re-, re- + dux, leader; see duke.]
    WaSP Accessibility Task Force Member
    splintered.co.uk | photographia.co.uk | redux.deviantart.com

  15. #15
    SitePoint Addict Ghz's Avatar
    Join Date
    Jun 2002
    Posts
    284
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally posted by redux

    i think it's worth checking email address...anything beyond that really is a waste of time
    Sorry but users can make thousands of accounts and register every time with a new one. Or he/ she may make a new email account just to register with.
    Most of the users won't notice that they have a cookie set in thier machines other than the username and the password, thus they won't delete it. I think the best way is to setcookie in thier machines, check the IP's, Check the email, and also check the user name as well. These steps won't take a second from the secript to check them all but finally we will reduce the number of re-registerations.
    Do you buy this??


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •