Session | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Session

Why should we set session_start(); before any output in our document? another question ๐Ÿ˜… I know that when we closed the browser session will be destroy and the sessionID changes every time we open a browser but how the server still stored data about users ? I think this make me confused to understand session and cookie well๐Ÿ˜…

15th Mar 2018, 12:03 PM
Aya Habeeb
Aya Habeeb - avatar
2 Answers
+ 2
of course to start that session you have to use session_start(); and that way you tell the program to start. and answer 2: I think sessions are more like cookies. hope you the best, yoosh ๐ŸŒท๐ŸŒท๐ŸŒท
17th Mar 2018, 4:02 AM
@mix_tory
@mix_tory - avatar
0
@mix_tory my question, what's happened if we put session_start in the end of our document ? why we should put it before any out put ? thank u ๐ŸŒธ
17th Mar 2018, 12:09 PM
Aya Habeeb
Aya Habeeb - avatar