Sessions/Cookies between sites

Ask a Question related to ASP Database, Design and Development.

  1. #1

    Default Sessions/Cookies between sites

    Hi All

    Can I just confirm, is it true that Session Vars and Cookies from my main
    http site will all be lost when I ask the user to transfer over to the
    secure (https) side of my site?

    Although the http and https sites are hosted on the same ISP they are under
    different domains (as well as protocols of course).

    Is it usually the case that I form post/get the intrinsic details back and
    forth between the http and https so that I can keep things on track?

    More importantly, if the user is still in the same session and they go to
    the https side of the site and then go back to the http side (they may want
    to check something - because they just do), has all of my session var and
    cookie data still be lost because of the change of sites? I have a feeling
    that my cookies will be OK, but my session vars may have been lost -
    correct?

    Rgds

    Robbie


    Astra Guest

  2. Similar Questions and Discussions

    1. Cookies and Sessions
      Hi, I am running on my dev machine Apache 1.3 and PHP 4.38, it is running on Windows XP when I try and use Cookies or Sessions nothing is being...
    2. Sessions, Cookies, DB, Form posts or all 4
      Hi All I'm in a quandary and I don't know whats best. Basically I have a secure section that takes the user through 4 stages before they...
    3. how to keep cookies or sessions between 2 sites?
      Hello, I have 2 separate web sites on 2 different boxes www.xyz.com on box 1 www2.xyz.com on box 2 Users log into box 1 via regular...
    4. [PHP] Sessions GET vs. Cookies
      --- Nicholas Robinson <npr@bottlehall.freeserve.co.uk> wrote: The session.use_trans_sid directive is enabled in your php.ini. Disable it if you...
    5. #24669 [Opn->Bgs]: Sessions and Cookies Timeout prematurely
      ID: 24669 Updated by: sniper@php.net Reported By: sunofman at sympatico dot ca -Status: Open +Status: ...
  3. #2

    Default Re: Sessions/Cookies between sites

    Yes, session variables and cookies will not be shared between the http and
    https sites (if the HTTP and HTTPS pages are in the same IIS application, it
    used to be possible to share session state, I don't know if that was a bug
    or a feature. I haven't tried it since IIS 4).

    Yes, you can pass data back and forth with form elements. A more secure
    approach would be to keep the user data in a database and pass only and
    identifier back and forth.

    As long as the user returns to one site or another within the session
    timeout period set in IIS their session variables will still be available.
    If cookies are not set to expire or they return before the cookie expires
    then cookies will be available as well.

    --
    Mark Schupp
    Head of Development
    Integrity eLearning
    [url]www.ielearning.com[/url]


    "Astra" <info@NoEmail.com> wrote in message news:40a0c0df_4@127.0.0.1...
    > Hi All
    >
    > Can I just confirm, is it true that Session Vars and Cookies from my main
    > http site will all be lost when I ask the user to transfer over to the
    > secure (https) side of my site?
    >
    > Although the http and https sites are hosted on the same ISP they are
    under
    > different domains (as well as protocols of course).
    >
    > Is it usually the case that I form post/get the intrinsic details back and
    > forth between the http and https so that I can keep things on track?
    >
    > More importantly, if the user is still in the same session and they go to
    > the https side of the site and then go back to the http side (they may
    want
    > to check something - because they just do), has all of my session var and
    > cookie data still be lost because of the change of sites? I have a
    feeling
    > that my cookies will be OK, but my session vars may have been lost -
    > correct?
    >
    > Rgds
    >
    > Robbie
    >
    >

    Mark Schupp Guest

  4. #3

    Default Re: Sessions/Cookies between sites

    From my experience with IIS6 and Windows Server 2003

    Session variables are still retained when switching from
    http to https, I never knew it was a bug, I hope Microsoft
    doesn't fix this one.

    (Since the session variables are based on a session ID
    cookie, it is really dependent on the client browser
    whether or not the session variables will be retained,
    it's up to the client browser to decide if it should
    include the SessionID cookie in it's https request).

    In the case of the original question, his https pages are
    on a different domain then the cookies and session
    variables will definitely not be retained.

    But if the user goes back to the http page before his
    session expires then the variables will still be there.

    Mendel Nemanov
    Spotlight Design
    >-----Original Message-----
    >Yes, session variables and cookies will not be shared
    between the http and
    >https sites (if the HTTP and HTTPS pages are in the same
    IIS application, it
    >used to be possible to share session state, I don't know
    if that was a bug
    >or a feature. I haven't tried it since IIS 4).
    >
    >Yes, you can pass data back and forth with form elements.
    A more secure
    >approach would be to keep the user data in a database and
    pass only and
    >identifier back and forth.
    >
    >As long as the user returns to one site or another within
    the session
    >timeout period set in IIS their session variables will
    still be available.
    >If cookies are not set to expire or they return before
    the cookie expires
    >then cookies will be available as well.
    >
    >--
    >Mark Schupp
    >Head of Development
    >Integrity eLearning
    >[url]www.ielearning.com[/url]
    >
    >
    >"Astra" <info@NoEmail.com> wrote in message
    news:40a0c0df_4@127.0.0.1...
    >> Hi All
    >>
    >> Can I just confirm, is it true that Session Vars and
    Cookies from my main
    >> http site will all be lost when I ask the user to
    transfer over to the
    >> secure (https) side of my site?
    >>
    >> Although the http and https sites are hosted on the
    same ISP they are
    >under
    >> different domains (as well as protocols of course).
    >>
    >> Is it usually the case that I form post/get the
    intrinsic details back and
    >> forth between the http and https so that I can keep
    things on track?
    >>
    >> More importantly, if the user is still in the same
    session and they go to
    >> the https side of the site and then go back to the http
    side (they may
    >want
    >> to check something - because they just do), has all of
    my session var and
    >> cookie data still be lost because of the change of
    sites? I have a
    >feeling
    >> that my cookies will be OK, but my session vars may
    have been lost -
    >> correct?
    >>
    >> Rgds
    >>
    >> Robbie
    >>
    >>
    >
    >
    >.
    >
    Guest

  5. #4

    Default Re: Sessions/Cookies between sites

    Thanks Guys

    Much appreciated.

    Rgds

    Robbie

    <anonymous@discussions.microsoft.com> wrote in message
    news:b46f01c4377f$ed462cf0$a401280a@phx.gbl...
    From my experience with IIS6 and Windows Server 2003

    Session variables are still retained when switching from
    http to https, I never knew it was a bug, I hope Microsoft
    doesn't fix this one.

    (Since the session variables are based on a session ID
    cookie, it is really dependent on the client browser
    whether or not the session variables will be retained,
    it's up to the client browser to decide if it should
    include the SessionID cookie in it's https request).

    In the case of the original question, his https pages are
    on a different domain then the cookies and session
    variables will definitely not be retained.

    But if the user goes back to the http page before his
    session expires then the variables will still be there.

    Mendel Nemanov
    Spotlight Design
    >-----Original Message-----
    >Yes, session variables and cookies will not be shared
    between the http and
    >https sites (if the HTTP and HTTPS pages are in the same
    IIS application, it
    >used to be possible to share session state, I don't know
    if that was a bug
    >or a feature. I haven't tried it since IIS 4).
    >
    >Yes, you can pass data back and forth with form elements.
    A more secure
    >approach would be to keep the user data in a database and
    pass only and
    >identifier back and forth.
    >
    >As long as the user returns to one site or another within
    the session
    >timeout period set in IIS their session variables will
    still be available.
    >If cookies are not set to expire or they return before
    the cookie expires
    >then cookies will be available as well.
    >
    >--
    >Mark Schupp
    >Head of Development
    >Integrity eLearning
    >[url]www.ielearning.com[/url]
    >
    >
    >"Astra" <info@NoEmail.com> wrote in message
    news:40a0c0df_4@127.0.0.1...
    >> Hi All
    >>
    >> Can I just confirm, is it true that Session Vars and
    Cookies from my main
    >> http site will all be lost when I ask the user to
    transfer over to the
    >> secure (https) side of my site?
    >>
    >> Although the http and https sites are hosted on the
    same ISP they are
    >under
    >> different domains (as well as protocols of course).
    >>
    >> Is it usually the case that I form post/get the
    intrinsic details back and
    >> forth between the http and https so that I can keep
    things on track?
    >>
    >> More importantly, if the user is still in the same
    session and they go to
    >> the https side of the site and then go back to the http
    side (they may
    >want
    >> to check something - because they just do), has all of
    my session var and
    >> cookie data still be lost because of the change of
    sites? I have a
    >feeling
    >> that my cookies will be OK, but my session vars may
    have been lost -
    >> correct?
    >>
    >> Rgds
    >>
    >> Robbie
    >>
    >>
    >
    >
    >.
    >

    Laphan Guest

  6. #5

    Default Re: Sessions/Cookies between sites

    Hi. I've seen this question a bunch of times, and I was interested in it as well, so I tried to pull together everyone's info.


    Session state cannot (and should not) be shared because it would be unsecure to do so. In fact, session data isn't completely secure unless you force an SSL connection. Even then, there are issues with older versions of IIS (5.1 and below) where your session state is lost of you browse from an SSL connection to a non-SSL connection, or vice versa.

    Using the application object will persist data in the application collection and make it available to all sessions in an app, but there's no way to restrict access.

    So, alternatives to sharing session state seem to be:

    - Use a SQL database to persist session variables at the end of each session. This allows for access restrictions. You can use the client's cookie as an identifier if you wish. (from 2 seperate posts)

    - Implement your own COM component with shared data. Your apps would call that component.

    - Use a message queuing system like MSMQ to save or cache data in a "queue which can either
    reside locally or on a dedicated server. Any application can read the queue
    once it knows the path to the queue - it typically does
    You can store the message in any format from text, to
    full blown datasets or custom objects. You can think of the msmq as a robust
    caching strategy over a network. It's a good approach because the msmq can
    be configured to be fail safe (survive reboots), back up messages, provide
    confirmation etc. In addition, msmq can be programmed in a line or two, but
    it does require the msmq service to installed and running on the machine." (from "How can I share cached data between web clients?")

    - Use the solution in the article at [url]http://www.asp101.com/articles/jayram/sharestate/default.asp[/url]. However, one poster said, "you can do what the article suggests without
    the massive delete, edit the .webinfo file crap if you set up the parent app
    and make the other "apps" subdirs of the parent app (importing, if child
    apps already completed). This is really a non-solution for most of us, as
    you are essentially killing the child apps and making a single parent app
    with all of your applications. You cannot set up the application on a unique
    CName, like app1.mydomain.com, as it is tied to the other apps*. Yuck"

    - Use remoting.

    - Use the Caching Application block.

    A good topic on MSDN is "State Management Recommendations" at [url]http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbcon/html/vbconchoosingserverstateoption.asp[/url]. It outlines some of the options above.



    "Laphan" wrote:
    > Thanks Guys
    >
    > Much appreciated.
    >
    > Rgds
    >
    > Robbie
    >
    > <anonymous@discussions.microsoft.com> wrote in message
    > news:b46f01c4377f$ed462cf0$a401280a@phx.gbl...
    > From my experience with IIS6 and Windows Server 2003
    >
    > Session variables are still retained when switching from
    > http to https, I never knew it was a bug, I hope Microsoft
    > doesn't fix this one.
    >
    > (Since the session variables are based on a session ID
    > cookie, it is really dependent on the client browser
    > whether or not the session variables will be retained,
    > it's up to the client browser to decide if it should
    > include the SessionID cookie in it's https request).
    >
    > In the case of the original question, his https pages are
    > on a different domain then the cookies and session
    > variables will definitely not be retained.
    >
    > But if the user goes back to the http page before his
    > session expires then the variables will still be there.
    >
    > Mendel Nemanov
    > Spotlight Design
    > >-----Original Message-----
    > >Yes, session variables and cookies will not be shared
    > between the http and
    > >https sites (if the HTTP and HTTPS pages are in the same
    > IIS application, it
    > >used to be possible to share session state, I don't know
    > if that was a bug
    > >or a feature. I haven't tried it since IIS 4).
    > >
    > >Yes, you can pass data back and forth with form elements.
    > A more secure
    > >approach would be to keep the user data in a database and
    > pass only and
    > >identifier back and forth.
    > >
    > >As long as the user returns to one site or another within
    > the session
    > >timeout period set in IIS their session variables will
    > still be available.
    > >If cookies are not set to expire or they return before
    > the cookie expires
    > >then cookies will be available as well.
    > >
    > >--
    > >Mark Schupp
    > >Head of Development
    > >Integrity eLearning
    > >[url]www.ielearning.com[/url]
    > >
    > >
    > >"Astra" <info@NoEmail.com> wrote in message
    > news:40a0c0df_4@127.0.0.1...
    > >> Hi All
    > >>
    > >> Can I just confirm, is it true that Session Vars and
    > Cookies from my main
    > >> http site will all be lost when I ask the user to
    > transfer over to the
    > >> secure (https) side of my site?
    > >>
    > >> Although the http and https sites are hosted on the
    > same ISP they are
    > >under
    > >> different domains (as well as protocols of course).
    > >>
    > >> Is it usually the case that I form post/get the
    > intrinsic details back and
    > >> forth between the http and https so that I can keep
    > things on track?
    > >>
    > >> More importantly, if the user is still in the same
    > session and they go to
    > >> the https side of the site and then go back to the http
    > side (they may
    > >want
    > >> to check something - because they just do), has all of
    > my session var and
    > >> cookie data still be lost because of the change of
    > sites? I have a
    > >feeling
    > >> that my cookies will be OK, but my session vars may
    > have been lost -
    > >> correct?
    > >>
    > >> Rgds
    > >>
    > >> Robbie
    > >>
    > >>
    > >
    > >
    > >.
    > >
    >
    >
    >
    Janet Fisher Guest

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139