marvin_g — 2013-03-11T11:39:33-04:00 — #1
hye guys, i had a problem where i need to pass a variable through .php page. i tried to use SESSION but it seems like after went to a page after another page, the file seems missing. how can i pass the same variable to few .php pages over and over again??
kylewolfe — 2013-03-11T11:46:54-04:00 — #2
For every page you wish to access SESSION, you must use session_start(). The session will survive multiple http request, even with a page that does not have the use of sessions.
marvin_g — 2013-03-11T12:12:52-04:00 — #3
yes i did use that method but after passing the variable to a page then i use windows.history.back () it seems that the previous need to be refresh and it does not look nice after all..any idea?
kylewolfe — 2013-03-11T12:53:01-04:00 — #4
Don't use history back? Why are using that anyway?
felgall — 2013-03-11T16:54:50-04:00 — #5
history.back will just reload the page from the browser cache - it doesn't download it again from the server and so doesn't have access to changes session values.
claro — 2013-03-11T23:36:28-04:00 — #6
use var_dump for troubleshooting.
marvin_g — 2013-03-12T20:26:21-04:00 — #7
the problem is when history.back reload the page from browswer cache, i got an error saying that "Document Expired. This document is no longer available.The requested document is not available in Firefox's cache.As a security precaution, Firefox does not automatically re-request sensitive documents.Click Try Again to re-request the document from the website." so i need to click "try again" everytime after that, then only the page will be reloaded.
kylewolfe — 2013-03-12T20:58:04-04:00 — #8
The root of your problem is that your using history.back. User header(), or some other approach.
marvin_g — 2013-03-12T21:29:00-04:00 — #9
marvin_g — 2013-03-12T21:33:19-04:00 — #10
problem solved. i used windows.location instead of windows.back. ^^
kylewolfe — 2013-03-13T09:30:14-04:00 — #11
Header() is the best practice here. Be in control of your app, don't emulate user interaction like that.