Results 1 to 10 of 10

Thread: how do cookies work

  1. #1
    Join Date
    May 2006
    Posts
    266
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default how do cookies work

    Just found a script that i am thinking of using for my website on twey.co.uk the code rocks.

    but my question is the following how do cookies work like i understand a littel bit how they are suppost to work but lets say some one when they log in click a link to see a page call about me is there any way when they log in they get that page straight away?

    i was thinking about using iframes and the include code how would these effect a cookie

  2. #2
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    but my question is the following how do cookies work like i understand a littel bit how they are suppost to work but lets say some one when they log in click a link to see a page call about me is there any way when they log in they get that page straight away?
    Yes indeed. Cookies work by storing a text file on the user's computer. This allows you to store some data that will be accessible to every page on your server that the user visits, whether it's in a frame, a seperate page, a new window, or whatever.

    In your case, you would store the intended page in a cookie, then redirect to the login page, then, after logging in, redirect to the page in the cookie.

    If you have some form of server-side scripting, sessions are usually a better idea than cookies. Sessions store data about the user on the server, then use a unique session identifier (usually a 16-digit hexadecimal number) to identify the user. This number can be passed from page to page by cookie or another means, such as a GET variable. Sessions are more secure than cookies since only the session ID is stored on the client (or sent over the network).

    Just found a script that i am thinking of using for my website on twey.co.uk the code rocks.
    Oh? Which one? They're all in the DD forums somewhere... the Fadable Objects script got rejected (too complicated) and the enhanced Encrypted Password script is awaiting approval.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  3. #3
    Join Date
    May 2006
    Posts
    266
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    i used this one enhanced Encrypted Password

    also where is a good site i can learn more about cookies and you say server-side scripting, sessions how would i know if my sever has that??

    i re sell server space so i have access to the whole server so where would i look or what would i look under. it is a linux server.

    Thanks

  4. #4
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    i re sell server space so i have access to the whole server so where would i look or what would i look under. it is a linux server.
    Do a "slocate php" and see.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  5. #5
    Join Date
    May 2006
    Posts
    266
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    what is slocate php and what do i do with it

  6. #6
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    It's a command. You execute it. It finds files with "php" in the filename. If you don't have any relevant files (specifically the "php" executable or mod_php.so), you don't have PHP.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  7. #7
    Join Date
    May 2006
    Posts
    266
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    oh yes my server can have phop i have a dating site on the same severs osdate
    here is there website www.tufat.com/osdate.php

  8. #8
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    Well, if you've got PHP you can use it to write server-side scripts. There's an official PHP introductory tutorial here, or a one by w3schools here.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  9. #9
    Join Date
    May 2006
    Posts
    266
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    ok well i don't understand any of that i mean the other website they are writen if i am already suppost to know what they do... sorry i just don't understand i have never made a php page in my life and if html or xml will do then why learn something i will hardly use? i just need to know if a cookie will work for what i want to do and how many cookies would i need to make so that they all work

    Sorry

  10. #10
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    i have never made a php page in my life and if html or xml will do then why learn something i will hardly use?
    Oh, you'll use it a lot, if you get used to it
    i just need to know if a cookie will work for what i want to do and how many cookies would i need to make so that they all work
    Yes, and one. However, Javascript is not a hugely reliable way to set a cookie, and since you'll be using a server-side script anyway (for the login script), I'd suggest modifying that to do what you want rather than using client-side scripts.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

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
  •