ExamBank Scot · AH Computing Science question bank · All AH Computing Science questions

AH Computing Science 2022 Question 10

3 marks · Sessions

Explain the use of session_start() and session_destroy() functions when using PHP to create a login system for a website.

Marking scheme

Session variables are used to enable a website to retain information from one page to another. session_start() used when user logs in to store user login details session_destroy() used at logout to remove any stored data 1 mark for use of session variables to share values across pages of the website 1 mark for accurate description of session_start() function 1 mark for accurate description of session_destroy() function

Previous question: AH Computing Science 2022 Question 9

Next question: AH Computing Science 2022 Question 11