Session problem

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Fran García

    #1

    Session problem

    I´ve a big problem with the session variables. I load audio files into
    media player using as src a php script that check some session
    variables and then load the audio file, something like that

    <mediaplayer src="displayfil e.php?filename= myaudiofile.mp3 ">

    but in the script displayfile.php , I cannot access to the session
    variables. Is there a way to see the session variables in the example
    above?

    Thanks in advance!

    Fran García

  • Erwin Moller

    #2
    Re: Session problem

    Fran García wrote:
    [color=blue]
    > I´ve a big problem with the session variables. I load audio files into
    > media player using as src a php script that check some session
    > variables and then load the audio file, something like that
    >
    > <mediaplayer src="displayfil e.php?filename= myaudiofile.mp3 ">
    >
    > but in the script displayfile.php , I cannot access to the session
    > variables. Is there a way to see the session variables in the example
    > above?
    >
    > Thanks in advance!
    >
    > Fran García[/color]

    Hi,

    You above example has no sessionvariable s.
    Most of the time the SESSION is kept by a cookie, but as part of the URL it
    is also possible.

    In the last case you would expect something like:
    <mediaplayer
    src="displayfil e.php?filename= myaudiofile.mp3 &PHPSESSID=gjfd s6a75fsda6f4">

    I would advise you first to check if session works as you expect, and then
    start working on streaming the audiofiles.

    This is a good place to start:


    Many things can go wrong when using sessions, to name a few:
    - different domains do not share cookie and session
    - you force session in cookie (via php.ini) but visitor blocks cookies.
    - PHP cannot write sessionfiels away to some dir because of permissions.
    etc.etc.

    So maybe the thing to do is first figuring out with a simple script IF your
    sessions work.

    Good luck!

    Regards,
    Erwin Moller

    Comment

    • Fran García

      #3
      Re: Session problem

      Yes, the sessions works right, but I think that the problem is that the
      displayfile.php is inside a media player object and it cannot inherit
      the session variables or something like that.

      I´m trying right now to read the session variables passing it through
      the GET variables.

      Comment

      • Fran García

        #4
        Re: Session problem

        Fran García wrote:[color=blue]
        > Yes, the sessions works right, but I think that the problem is that the
        > displayfile.php is inside a media player object and it cannot inherit
        > the session variables or something like that.
        >
        > I´m trying right now to read the session variables passing it through
        > the GET variables.
        >[/color]
        I´ve fixed my own problem passing the session_id into a get string and
        then loading in the script the session with the name passed through the
        GET string.

        <mediaplayer
        src="displayfil e.php?session_i d=af24234ls&fil ename=myaudiofi le.mp3">

        and then in the displayfile.php

        session_id($ses sion_id);
        session_start() ;

        Comment

        Working...