Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. Linux, Apache, MySQL, PHP
  4. Shared Cookie

Shared Cookie

Scheduled Pinned Locked Moved Linux, Apache, MySQL, PHP
csharpcomquestion
9 Posts 5 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • F Offline
    F Offline
    FeRtoll
    wrote on last edited by
    #1

    When user visit www.site1.com i need to set cookie with time of visit. Then when user visit www.site2.com or www.site3.com i need to read cookie from www.site1.com so i know visitor time. Is there way to set one cookie for multiple websites or multiple cookies for diferent sites?

    FeRtoll Software.net ------------ E-Mail me WebPage

    S C F 3 Replies Last reply
    0
    • F FeRtoll

      When user visit www.site1.com i need to set cookie with time of visit. Then when user visit www.site2.com or www.site3.com i need to read cookie from www.site1.com so i know visitor time. Is there way to set one cookie for multiple websites or multiple cookies for diferent sites?

      FeRtoll Software.net ------------ E-Mail me WebPage

      S Offline
      S Offline
      Smithers Jones
      wrote on last edited by
      #2

      I found this[^] on stackoverflow.com via Google, maybe it will help you?

      "I love deadlines. I like the whooshing sound they make as they fly by." (DNA)

      1 Reply Last reply
      0
      • F FeRtoll

        When user visit www.site1.com i need to set cookie with time of visit. Then when user visit www.site2.com or www.site3.com i need to read cookie from www.site1.com so i know visitor time. Is there way to set one cookie for multiple websites or multiple cookies for diferent sites?

        FeRtoll Software.net ------------ E-Mail me WebPage

        C Offline
        C Offline
        cjoki
        wrote on last edited by
        #3

        You should find what you want by making use of a database session manager instead of the default one in php. You can google this and find a number of articles on how to implement this. Besides sharing the session data between different domains you can also use this for load balancing multiple servers.

        G 1 Reply Last reply
        0
        • C cjoki

          You should find what you want by making use of a database session manager instead of the default one in php. You can google this and find a number of articles on how to implement this. Besides sharing the session data between different domains you can also use this for load balancing multiple servers.

          G Offline
          G Offline
          Gerben Jongerius
          wrote on last edited by
          #4

          And how would you identify a session without setting it in a cookie that multiple sites can access. (Which cannot be done btw.) You can set cookies for multiple of domains, or even easier call an image (PHP file) of another website that sets the cookie for you. (EG: call example2.com/images/cookie.php?mydta=1 from example.com)

          C 1 Reply Last reply
          0
          • F FeRtoll

            When user visit www.site1.com i need to set cookie with time of visit. Then when user visit www.site2.com or www.site3.com i need to read cookie from www.site1.com so i know visitor time. Is there way to set one cookie for multiple websites or multiple cookies for diferent sites?

            FeRtoll Software.net ------------ E-Mail me WebPage

            F Offline
            F Offline
            FeRtoll
            wrote on last edited by
            #5

            nevermind i found the way to do this! ;P

            FeRtoll Software.net ------------ E-Mail me WebPage

            L 1 Reply Last reply
            0
            • F FeRtoll

              nevermind i found the way to do this! ;P

              FeRtoll Software.net ------------ E-Mail me WebPage

              L Offline
              L Offline
              Luc Pattyn
              wrote on last edited by
              #6

              and it would be good for you to post it here, so others can benefit. :)

              Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles] Nil Volentibus Arduum

              Please use <PRE> tags for code snippets, they preserve indentation, and improve readability.

              F 1 Reply Last reply
              0
              • L Luc Pattyn

                and it would be good for you to post it here, so others can benefit. :)

                Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles] Nil Volentibus Arduum

                Please use <PRE> tags for code snippets, they preserve indentation, and improve readability.

                F Offline
                F Offline
                FeRtoll
                wrote on last edited by
                #7

                i will post here once i get my project full tested and finished!

                FeRtoll Software.net ------------ E-Mail me WebPage

                L 1 Reply Last reply
                0
                • F FeRtoll

                  i will post here once i get my project full tested and finished!

                  FeRtoll Software.net ------------ E-Mail me WebPage

                  L Offline
                  L Offline
                  Luc Pattyn
                  wrote on last edited by
                  #8

                  :thumbsup:

                  Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles] Nil Volentibus Arduum

                  Please use <PRE> tags for code snippets, they preserve indentation, and improve readability.

                  1 Reply Last reply
                  0
                  • G Gerben Jongerius

                    And how would you identify a session without setting it in a cookie that multiple sites can access. (Which cannot be done btw.) You can set cookies for multiple of domains, or even easier call an image (PHP file) of another website that sets the cookie for you. (EG: call example2.com/images/cookie.php?mydta=1 from example.com)

                    C Offline
                    C Offline
                    cjoki
                    wrote on last edited by
                    #9

                    you forgot that a session ID can also be stored in a url, which can be passed between the user and server. all session data would have to be stored in a common session database and you may still need to make custom session functions.

                    1 Reply Last reply
                    0
                    Reply
                    • Reply as topic
                    Log in to reply
                    • Oldest to Newest
                    • Newest to Oldest
                    • Most Votes


                    • Login

                    • Don't have an account? Register

                    • Login or register to search.
                    • First post
                      Last post
                    0
                    • Categories
                    • Recent
                    • Tags
                    • Popular
                    • World
                    • Users
                    • Groups