Data hashing will
-
Ensure that the data has not been tampered with
-
Ensure that the session is valid
-
Ensure that the user is valid
-
All of the above
Hashing creates a fixed-size digital fingerprint that uniquely represents data. If even a single bit changes, the hash will be completely different, making it an excellent mechanism for detecting data tampering. Session validity and user authentication require different mechanisms like expiration tokens and credential verification.
A cryptographic hash produces a fixed-size fingerprint of data; if even one bit of the underlying data changes, the hash changes too. Comparing a stored hash to a freshly computed one lets you detect tampering with the data's integrity — it says nothing about who the user is or whether their session is valid, which are separate authentication/session-management concerns.