SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Member
    Join Date
    Feb 2005
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Session and Cookies

    I have a question ...

    Do I need today to make workarounds for people that have disabled cookies ??

    IMO most people have cookies enabled ... but I'm not completly sure

    What's your opinion ?? Do you care of people with disabled cookies ?? And do you have any numbers and statistics ??

    Thanks very much

  2. #2
    SitePoint Addict phpster's Avatar
    Join Date
    Feb 2005
    Location
    Toronto, Canada
    Posts
    374
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Pass the session id in the url via trans_id
    From the manual
    Passing the Session ID

    There are two methods to propagate a session id:

    *

    Cookies
    *

    URL parameter

    The session module supports both methods. Cookies are optimal, but because they are not always available, we also provide an alternative way. The second method embeds the session id directly into URLs.

    PHP is capable of transforming links transparently. Unless you are using PHP 4.2 or later, you need to enable it manually when building PHP. Under Unix, pass --enable-trans-sid to configure. If this build option and the run-time option session.use_trans_sid are enabled, relative URIs will be changed to contain the session id automatically.

    Note: The arg_separator.output php.ini directive allows to customize the argument seperator. For full XHTML conformance, specify & there.

    Alternatively, you can use the constant SID which is always defined. If the client did not send an appropriate session cookie, it has the form session_name=session_id. Otherwise, it expands to an empty string. Thus, you can embed it unconditionally into URLs.
    phpster

    I wish my computer would do what I want it to.
    Not what I tell it to do...

  3. #3
    SitePoint Member
    Join Date
    Feb 2005
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    There was something diffrerent in my mind
    ( hope you understand it )

    Actually I'm working a on bigger project a and I need to have it Search Engine Optimized ..... a putting SID into the URL would make URLs a little bit confusing for robots

    My question was, if it's worth to put SID into the URL or I should not think on them ( with disabled cookies )

    Thanks

  4. #4
    SitePoint Addict phpster's Avatar
    Join Date
    Feb 2005
    Location
    Toronto, Canada
    Posts
    374
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Well the use of mod_rewrite (altering the url) would take care of
    a. hiding the url
    b. making it more SEO

    If cookies are diabled, you are basically left with three options;
    user must use (and activate) cookies for sessions
    use trans_sid and make it transparent with mod_rewrite
    try and manage the sessions without the use sessions/cookies by placing the session id in a hidden form element and using the db to track IPs and whatever else you want to...
    phpster

    I wish my computer would do what I want it to.
    Not what I tell it to do...


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
  •