[SOLVED] New ways of newbies(me) breaking sessions!
Posted: Wed Feb 22, 2006 2:20 pm
I'm a perl programmer mostly and I dabble in ASP.net. I'm just getting into PHP, but I have a tendancy to break things... a lot. I've fixed most of the problems and everything was running smoothly before the holiday. However, I must've been bashing away at the keyboard in a semi-drunken haze on friday because what I remember working is now failing miserably! I've done something and now my sessions don't even work!
I was playing around with CAPTCHA_Text and it was working perfectly at home. I got it to recognize me entering various randomly generated CAPTCHAs which stored the phrase in a session var. Today everything went awry and I'm getting some odd errors. Specifically:
Gives me:
"Notice: Undefined index: counter in C:\www\Apache2\htdocs\testsessions.php on line 7
You have viewed this page 1 times"
No matter how many times I refresh it. I'm using mozilla's web developer toolbar and I'm seeing no cookies, HOWEVER there are definitely sessions being stored in my directory. My captcha script is also creating images based on session IDs when I run it(and not deleting them properly, but that may be a permissions issue). Obviously, I need cookies to propogate the session so I can keep some sort of state. I'm running Apache 2.0.55 and PHP 5.somethingoranother on XP SP2.
My PHP.ini looks like this:
Any help is appreciated!
I was playing around with CAPTCHA_Text and it was working perfectly at home. I got it to recognize me entering various randomly generated CAPTCHAs which stored the phrase in a session var. Today everything went awry and I'm getting some odd errors. Specifically:
Code: Select all
<?php
// initialize a session
session_start();
// increment a session counter
$_SESSION['counter']++;
// print value
echo "You have viewed this page " . $_SESSION['counter'] . " times";
?>"Notice: Undefined index: counter in C:\www\Apache2\htdocs\testsessions.php on line 7
You have viewed this page 1 times"
No matter how many times I refresh it. I'm using mozilla's web developer toolbar and I'm seeing no cookies, HOWEVER there are definitely sessions being stored in my directory. My captcha script is also creating images based on session IDs when I run it(and not deleting them properly, but that may be a permissions issue). Obviously, I need cookies to propogate the session so I can keep some sort of state. I'm running Apache 2.0.55 and PHP 5.somethingoranother on XP SP2.
My PHP.ini looks like this:
Code: Select all
[Session]
session.save_handler = files
session.save_path = "C:\PHP\sessions"
session.use_cookies = 1
session.use_only_cookies = 1
session.name = PHPSESSID
session.auto_start = 0
session.cookie_lifetime = 0
session.cookie_path =
session.cookie_domain = localhost
session.serialize_handler = php
session.gc_probability = 1
session.gc_divisor = 1000
session.gc_maxlifetime = 1440
session.bug_compat_42 = 1
session.bug_compat_warn = 1
session.referer_check =
session.entropy_length = 0
session.entropy_file =
session.cache_limiter = nocache
session.cache_expire = 180
session.use_trans_sid = 0
session.hash_function = 1
session.hash_bits_per_character = 5
url_rewriter.tags = "a=href,area=href,frame=src,input=src,form=fakeentry"