Keeping the same session_id when a page is refreshed

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 ...


Go Back   Usenet Forums > PHP Programming Forums > PHP Language

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 01-10-2005
jaf893@gmail.com
 
Posts: n/a
Default Keeping the same session_id when a page is refreshed

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?

Reply With Quote
  #2 (permalink)  
Old 01-10-2005
claudel@gmail.com
 
Posts: n/a
Default Re: Keeping the same session_id when a page is refreshed

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

Reply With Quote
  #3 (permalink)  
Old 01-10-2005
jaf893@gmail.com
 
Posts: n/a
Default Re: Keeping the same session_id when a page is refreshed

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.

Reply With Quote
  #4 (permalink)  
Old 01-10-2005
claudel@gmail.com
 
Posts: n/a
Default Re: Keeping the same session_id when a page is refreshed

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

Reply With Quote
  #5 (permalink)  
Old 01-11-2005
Chung Leong
 
Posts: n/a
Default Re: Keeping the same session_id when a page is refreshed


<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.


Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT +1. The time now is 09:46 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0