280 posts
Location
Earth
Posted 07 October 2012 - 02:58 PM
I have an issues and that I tried to make a program to log in to my site it will set the $_SESSION variables but it will not remember then on the next http download.
I use
session_start();
header("Cache-control:private");
to start the session on each page.
236 posts
Posted 07 October 2012 - 03:07 PM
These work together? oh my lord! i was unaware of that,
on the problem side:
Youre not supposed to start a session at every page, only the login one. Youre currently setting the variables in a session and then creating a new session, wich of course doesnt have the variables set, so just remove the session_start() parts form all the pages exept the login one- should work.
84 posts
Posted 08 October 2012 - 06:09 AM
These work together? oh my lord! i was unaware of that,
on the problem side:
Youre not supposed to start a session at every page, only the login one. Youre currently setting the variables in a session and then creating a new session, wich of course doesnt have the variables set, so just remove the session_start() parts form all the pages exept the login one- should work.
???
You dont know much PHP obviously, if you dont start session you dont have access to session variables!
Also session works with the current session… hence if you do one connection then another they will be different sessions!
236 posts
Posted 08 October 2012 - 12:12 PM
BUT never end the session, exept at logout, then you have a session from login to logout and it should work
445 posts
Posted 08 October 2012 - 12:15 PM
Hm isn't the browser passed a PHP-Session-ID or something?
280 posts
Location
Earth
Posted 09 October 2012 - 02:29 AM
These work together? oh my lord! i was unaware of that,
It does. You just have to remember that its the source code you want and not the <html>
Hm isn't the browser passed a PHP-Session-ID or something?
(one search later) That rights.
The session_start( ) function generates a random Session Id and stores it in a cookie on the user's computer
Since Computer Crafts http-api is not really a browser and dose not store cookies the session can never pass back
PHPSESSID. :-/ I guess I can try to mimic the session processes manually, by storing a text file with an id and then storing the variable on the site. and then use $_GET to send the "session id".