Web Hosting Talk







View Full Version : php, sessions and MS Media Player


okok
06-09-2004, 11:53 AM
Perhaps someone here has an idea about this problem.

I have a php script that checks whether a user is logged in, that is, whether some session variable exists. If they are, it sends the user a WMV video file. If not, it displays a login page.

This works great on most systems. Usually, if the user is logged in, the video opens in their MS Media Player. However, on a win98se, IE 6, MediaPlayer 9 system I have, the media player fails to download and open the video.

To my understanding, this is probably because when the MediaPlayer tries to access the URL it receives from the browser, it does not share the same session as the broswer, and therefore actualy gets the login page and not the wmv file.

Is there anything I can do to prevent this behaviour? For the time being, I ask users to save the WMV locally and then open. But I want users to be able to open it automatically when they click a link.

Thanks

Burhan
06-10-2004, 03:16 AM
You can try enabled session_transid (if not already enabled -- its enabled by default on recent PHP installations). This allows your session to be carried over to other pages.

Although I think it might be a browser problem.

Rich2k
06-10-2004, 04:34 AM
session_transid is only a factor if the user doesn't support cookies. Usually session_transid is enabled (well at least one the recent versions of PHP).

You might like to DISABLE session cookies and enable session_transid as then you will know that the session will be carried across all urls. However you need to manually add the session in for header() functions and scripting document.location statements using

echo strip_tags(SID);