SitePoint Sponsor

User Tag List

Results 1 to 3 of 3

Thread: php session ID

Hybrid View

  1. #1
    SitePoint Member
    Join Date
    Aug 2000
    Posts
    10
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    My host recompiled php with --enable-trans-id or whatever it is to turn on the auto-appending of the PHPSESSID to each link. Now, one some of the links PHPSESSID is insert in the middle of the url after the '?'. For example the link should be http://www.whatever.com/browse.php?cid=12&sid=0 but it is comes out as http://www.whatever.com/browse.php?c...5a82f252e15c=0
    The PHPSESSID is inserted between the sid and the =0. This happens consistatly on the same links in the same way. When i refresh the page the problem is gone.
    I have a session_start() at the top of the page, because I use sessions for user logins.

    Any help would be very much appreciated,
    Lenny

  2. #2
    Dumb PHP codin' cat
    Join Date
    Aug 2000
    Location
    San Diego, CA
    Posts
    5,460
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Try creating your link ahead of time and then use it in your href tag

    like
    $link = sprintf('%s?cid=%s&sid=%s', $PHP_SELF, $cid, $sid);
    printf('<a href="%s">somelink</a>', $sess->url($link));

  3. #3
    SitePoint Member
    Join Date
    Aug 2000
    Posts
    10
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Most of the links are actually straight html, not generated dynamicly, outside the <? and ?>. If there are no other ways to fix it I guess i'll your your suggestion, so thanx for that, but it'll increase the load time for no good reason.


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
  •