Jump to content

js file fails with session_start()


greenie__

Recommended Posts

Hi

i've had this problem and i've had this problem before. IE fails to accept cookies when a js file is being loaded from a tag and i think it causes similar problems with flash files loading movies too. The cookies are sent to php properly and i can access the session id form the file but as soon as i use session start it tries to extend the session cookie life i think which causes ie to die. I've searched the php site and the net for a way to use a session id to activate a session without it sending a cookie for this one page only but i cannot. I would prefer to use the cookie session method.

Link to comment
https://forums.phpfreaks.com/topic/70418-js-file-fails-with-session_start/
Share on other sites

session_start() has to be right at the top of your page before any HTML or white space coding.

 

what error are you getting?

 

i dont understand exacly what's dieing.. could you paste the code that your having issues with.

 

regards

Liam

Yes it is at the top of the page nothing has been sent before it.

The problem is with ie that it cannot accept cookies when it is accessing files in a certain why like how it access something loaded by the <script type="text/javascript" src=""></script> tag but also how flash loads flash movies into itself causes the same problem.

 

And session start will automatically send a cookie to browser to extend the cookies life but this causes ie to abort downloading the file and the file will never load. in ff it works fine. no error is being produced by php cause an error has not occurred on the server.

 

i can still access the session id through a cookie but i cant access the session without it sending a cookie to browser.

 

what i want to know is there a way to access a session that already exists with a  cookie already on the client and access the session without it reissuing the cookie.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.