5
Contributors
14
Replies
15
Views
8 Years
Discussion Span
Last Post by nav33n
0

Thank you for answer.

I tried to set a session name, right now, but the behavior is the same.

First time I access this page, session is created. Any CTRL-R to refresh page access the same session. Clicking at address bar and hitting ENTER give the same session too.

If I click at that link, sometimes it gets the same session, but at most it restart the session, as in first time.

Then, if I click at address bar and hit ENTER, it recover that first session opened. Very weird to me...

I am running WAMP (php 5+apache), on Windows XP, using Firefox and IExplorer (same behavior in both browsers).

Thank you for your attention.

0

im looking at the code and im not recognizing your ++$_SESSION. What is this doing?
if the session is set you are setting the session to ++ correct? Could this be why you are having the problems? What happens if you comment this area out?

0

Umm..That shouldn't reset the session.. But anyway, you can try with an echo statement..
But this is strange.. Are you sure you dont have session_destroy or session_regenerate_id in your script ? hmm..

0

Hi... Thank you for your response.

++$_SESSION is equals to $_SESSION = $_SESSION + 1

It does not reset the script, as you said.

That code I posted is one of my tests. If I run only that code, that problem happens... If I click at link (a href) new session is created... :( Then, if I go to address bar and hit ENTER, that old session (real one) is taken...

0

Hello,

Just a quick quesiton, are you a 100% sure the session data file is being stored locally on the machine? (had a similar issue when the /tmp folder on a linux box was full), ensure that session storage is correct and working - the code itself though is without fault. The other option would be to set a cookie, and using a session based cookie and comitting data to that (data stored in cookie, as opposed to an ID pointing to a server-side session file).

Kind Regards,
Dan

0

Yeap, I am 100% sure. I saw the session Id and saw the file sess_XXXXXX stored at "session.save_path".

I tested with "session.use_only_cookies" set , but the behavior is the same. I think I will re-install that wamp and try again :(

Here is my PHP.INI, maybe something wrong in it:

session
Session Support  enabled  
Registered save handlers  files user sqlite  
Registered serializer handlers  php php_binary wddx  

Directive Local Value Master Value 
session.auto_start Off Off 
session.bug_compat_42 Off Off 
session.bug_compat_warn On On 
session.cache_expire 180 180 
session.cache_limiter nocache nocache 
session.cookie_domain no value no value 
session.cookie_httponly Off Off 
session.cookie_lifetime 0 0 
session.cookie_path / / 
session.cookie_secure Off Off 
session.entropy_file no value no value 
session.entropy_length 0 0 
session.gc_divisor 1000 1000 
session.gc_maxlifetime 1440 1440 
session.gc_probability 1 1 
session.hash_bits_per_character 5 5 
session.hash_function 0 0 
session.name testao PHPSESSID 
session.referer_check no value no value 
session.save_handler files files 
session.save_path c:/wamp/tmp c:/wamp/tmp 
session.serialize_handler php php 
session.use_cookies On On 
session.use_only_cookies Off Off 
session.use_trans_sid 0 0
0

One more result, a new WAMP installed, new directory, etc, same behavior... Now, trying to install just PHP.

0

And, latest news: I installed Apache+PHP (separated directory, other save_path, etc), and the behavior is the same.....

Why my "A HREF" are not keeping the session?
:( OMG

0

I tried to change my link to add this:

?< ?php echo session_name().'='.session_id();?>

Thus, my HREF works.... But, how can I set to LINKs be modified automaticaly in PHP????

Thank you.

0

Hello,
I have tried your code and works fine....
Best,

Thank you very much...

Now I have other behavior :( The session is not lost, but I need to wait 5 seconds untill press some link... Otherwise, new session is created o_O

Do you know why this can happens???

Thank you again....

0

Huh! Strange.. Your session settings in php.ini looks good.. Your script executes without a problem here.. :-/ I don't understand !

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.