1

I have a php page that store a session variable. One of the link is a .html page, with link back to some php pages. When I travel back to php page, would the session variable still be accessible?

Sorry if the answer to this would be obvious since I am not familiar with sessioning. Maybe the session is recorded in the server?

3
  • 1
    Yes the session keeps its value. Commented Aug 24, 2012 at 13:25
  • In case you're unsure, you can create a cookie. :) Commented Aug 24, 2012 at 13:27
  • assuming your session is stored in the cookie and not being passed via the URL, then yes it should still be there. Commented Aug 24, 2012 at 13:28

1 Answer 1

1

Yes, the session will persist. A session is a cookie value that is set once by the server that the client then sends back to the server on each new request. The client will send the cookie back to the HTML page as well, it just won't do anything with it. The cookie and session both persist until they expire, regardless of what page the user visits in between.

Sign up to request clarification or add additional context in comments.

2 Comments

the only caveat is that if the user has cookies disabled, and the session id was being passed via URL PARAM, it would get lost once it hit the non php page.
Agreed. Hopefully this issue does not exist in this day and age, since session values in the URL are a no-no.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.