This is a discussion on Keeping the same session_id when a page is refreshed within the PHP Language forums, part of the PHP Programming Forums category; I have the following script: <?PHP session_start(); echo session_id(); ?> But it gives a different session_ID() everytime the page ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
I have the following script:
<?PHP session_start(); echo session_id(); ?> But it gives a different session_ID() everytime the page is reloaded. Is there any way to keep the same session_ID() until the browser window is closed? |
|
|||
|
There are two methods to propagate a session id: cookies & URL
parameter. I suppose you are using the first one. The most probable cause is the fact that you do not have cookies enabled in your browser. Another thing might be the fact that you have not set up the session.save_path variable in php.ini... Clau |
|
|||
|
I`m blank then. The only times I had this problem was when
session.save_path was pointing to a bogus directory _OR_ the disk was full/did not have write acces there. On Windows you should use single backslashes (i.e. w:\php\sessions) with no trailing slash. Clau |
|
|||
|
<jaf893@gmail.com> wrote in message news:1105358280.300156.7740@c13g2000cwb.googlegrou ps.com... > I have cookies enabled and I have session.save_path setup in php.ini > and it still doesn't work in either Firefox or Internet Explorer. > Make sure the folder in fact exists. PHP won't create it itself. And use forward slashes in the path even when it's on Windows. That's the preferred practice for both PHP and Apache. Do a print_r($_COOKIE) at the end of the page to see if you're actually receiving the cookie. |