Jump to content

PHP session won't work [AGAIN]


[dx]

Recommended Posts

No, I don't change anywhere.. Today I've tried to store data from index.php file (not calling from function), and it worked.Like it not allow storing from function.. I guess I'll must find other way to solved this. I have one idea on my mind but this is easier way for me.. After some research, I notified that it won't store when it is called in remote file, but when in index.php (some file which is directly loaded to browser) it is ok.

Link to comment
Share on other sites

I solved this by adding @session_start(); at top of files which works with $_SESSION. Maybe it's wild method but works.

Link to comment
Share on other sites

it is, because you aren't really solving the problem, you are just surpressing it. It doesn't seem that hard to have one central place for session start to be called. If you are using it in multiple locations and they are conflicting with each other, it may be worth reconsidering how your application loads.

Link to comment
Share on other sites

First session_start() is at top of index.php file.And every page loads trough index like index.php?page?some_page And it starts while using page for view, but other server side files messes up, so I need add @session_start() And session is started, with index.php load, but nothing is written to session file, but nevermind, it works.

Link to comment
Share on other sites

If everything is loaded through index, then why have multiple session_start() calls going on elsewhere?

Link to comment
Share on other sites

There are server side files which works only with AJAX, and which are not loaded by index. So session in those files won't work, in loaded by index works fine.

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...