SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Evangelist Tapan's Avatar
    Join Date
    May 2005
    Location
    India
    Posts
    564
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Session data not coming on next page

    Hi,

    I have a simple login script which set $_SESSION["user_id"] to 1. But on a specifc page in which is using mod-rewrite ...does not gets that and session array is empty. But if I goto any other page which does not uses mod-rewrite then it works. My mod-rewrite code is simple:

    Code:
    DirectoryIndex index.php
    RewriteEngine On
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-l
    RewriteRule .* showpage.php [QSA,L]
    It just redirects all to showpage.php which simply extracts the URL but somehow the sessions array is empty in this page. Weird.

    How do I debug this or find out why the session data is not coming on this page ???

    Thanks.

  2. #2
    From space with love silver trophy
    SpacePhoenix's Avatar
    Join Date
    May 2007
    Location
    Poole, UK
    Posts
    5,034
    Mentioned
    103 Post(s)
    Tagged
    0 Thread(s)
    When mod-rewrite is disabled for the page concerned, does the session data then pick up ok?

    Does the page concerned call session_start() before trying to access the $_SESSION array?
    Community Team Advisor
    Forum Guidelines: Posting FAQ Signatures FAQ Self Promotion FAQ
    Help the Mods: What's Fluff? Report Fluff/Spam to a Moderator


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
  •