Session data is not displayed when cookies are disabled

I am new to PHP and experimenting with cookies and sessions.

So, in IE, if I set my privacy settings to block all cookies, it’s obvious that all cookies will be blocked, but what about sessions?

I ask because I have the impression that if the cookies are blocked, but I am starting a session, the session must be valid. In other words, everything I set for the session variable should stick to the browser as long as the browser is open, but this does not seem to happen.

My whole thought process is that I could use a cookie as my first means of tracking, and in addition to setting cookies, I could also set up a session if cookies were disabled.

So, question 1 - Why is my session variable blocked? Is this supposed to happen? Question 2 - Is it good practice to set both a cookie and a session (if the cookie is blocked)?

+3
source share
3 answers

Sessions, for the most part, are just the identifier associated with the data set for each user.

cookie. cookie , cookie , . URL-, (.. , ).

PHP URI, . . " " . ( .)

+2

, - , . cookie . cookie , , cookie . , .

cookieless, URL- ( URL- , , - ). , PHP .

Cookies , , , . , cookie , . , , , .

+2
  • Session is not blocked. But the session identifier changes every request. Therefore, obviously, you do not see your data.
  • They are used for different things. Therefore, it cannot be said that this is good or bad.
+1
source

All Articles