Junior PHP Developer Question:
Download Questions PDF

Explain what is the difference between Session and Cookie?


The main difference between sessions and cookies is that sessions are stored on the server, and cookies are stored on the user's computers in the text file format. Cookies can not hold multiple variables, But Session can hold multiple variables. We can set expiry for a cookie, The session only remains active as long as the browser is open. Users do not have access to the data you stored in Session, Since it is stored in the server.Session is mainly used for login/logout purpose while cookies using for user activity tracking

Download Junior PHP Developer Interview Questions And Answers PDF

Previous QuestionNext Question
Explain what is the use of "echo" in php?How to select a database in PHP?