Menu

Session values problem please help me?

Help
2003-06-02
2003-06-04
  • venkat ram reddy

    Hi,

    this is my first project I am using phrame. It is easy and very nice. The problem I am facing is when ever I register the session value. I am not able to get it back.

    I have made action class for login, when user gets authentication I am storing his ID in session and forwadring the page(ActionForward) to another page and $_REDIRECT I have set to true. Then in the redirected I am not able to fetch the session stored value. I don't know where is the problem.

    I can send my source also if any this is wrong please let me know.

    ThankQ
    jami

     
    • Bill Wheaton

      Bill Wheaton - 2003-06-04

      I think your problem, is that _REDIRECT should be false.  When it is false, SID gets put at the end of the uri, and thus the session id gets passed on.  When it is true, SID is left off and the session is destroyed.  Note, that whether _REDIRECT is 1, or 0, a redirect happens regardless.  Notice this code from ActionController's _processForward method:
      if (!$redirect) {
          header("Location: $path&".SID);
      } else {
          $_SESSION = array();
          session_destroy();
          header("Location: $path");
      }

      I don't think its right, either way, what gets sent back to the browser is a "Location: ....." header.  There is a major problem with this, particular to indexing sites like google, yahoo, etc..  Whenever they hit a uri at your site, and it returns a redirect (a "Location: ..." ) such as the above code does, always, They abandon any further site indexing.  There has to be a better way to do this, but I'm new to PHP, and I'm still having to figure out whats going on with this MVC thing, particularly the V and M part!  According to what I've read, its the Controller that should be asking a View dispatcher for the next view.  The returned view should be creating the output to the browser either directly with html content headers or indirectly with Location headers.  Location redirects are fine, they work, but it takes an extra round trip to the browser first.  Will the next version of Phrame take this into account?

      Thanks,
      Bill Wheaton

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.