السلام عليكم شباب الفريق العربي
اخوكم جديد في دخول عالم البي اتش بي وانا اقرا بالمواضيع والدروس وبصراحة الى الان ما شفت اي مشكلة يمكن لاني من مبرمجي السي ++ وساعدتني كثيرا في فهم البي اتش بي المهم لكن عندما وصلت لموضوع ال Session قرات انه "عبارة عن متغير يستخدم في تخزين المعلومات عن شخص او تغيير اعدادات مستخدم ويحفظ المعلومات لفترة لمستخدم مفرد باستخدام مفتاح وحيد " وتكون مؤقته لغاية ما يترك المستخدم الصفحة . اوكي الى هنا واضح :D بس بما اني مبتدا ما فهت ما هي الية الSession في السيرفر كيف يتم تخصيص المساحة له في السيرفر ؟ وكم المساحة؟ ومن يقوم بتحديد المساحة؟ وهل المساحة من ضمن المساحة المؤجرة من السيرفر ؟ هل تشبه مثلا الذاكرة الظاهرية في فكرتها ؟ ياريت لو حد فاهم يشرحلنا هلنقطة مع مثال على استخداماتها واللي فهمته ان cookie يخزن على جهاز المستخدم وال Session على السيرفر والcookie فيه اكسباير والSession يدمر عند خروج المستخدم من الصفحة
اقتباسPHP Session VariablesWhen you are working with an application, you open it, do some changes and then you close it. This is much like a Session. The computer knows who you are. It knows when you start the application and when you end. But on the internet there is one problem: the web server does not know who you are and what you do because the HTTP address doesn't maintain state.
A PHP session solves this problem by allowing you to store user information on the server for later use (i.e. username, shopping items, etc). However, session information is temporary and will be deleted after the user has left the website. If you need a permanent storage you may want to store the data in a database.
Sessions work by creating a unique id (UID) for each visitor and store variables based on this UID. The UID is either stored in a cookie or is propagated in the URL.