tags:

views:

219

answers:

3

I am having a really unsual problem I have never had before, I have a signup page/form and a processing page that for submits to, on the processing page I set any errors that are in the user data like empty fields and set them to a session var array

$_SESSION['signup_errors'] = $signup_errors;

$signup_errors is an array that I set to the session, I can then access that session data on the same page but I just changed my site around to use mod-rewrite to change the URL's and the only thing that I can seem to think of is on my signup form I cannot access these session variables anymore and now that I use mod-rewrite the url is like this domain.com/account/new and it used to be domian.com/?p=account.new so now it appears that it is in a differnt folder, could that have something to do with it?

I have tried debugging it a lot and that is the only thing I can come up with is maybe because it appears to be a different directory now because of the mod-rewrite maybe that makes the session unaccessible?

+2  A: 

Are you sure you're starting sessions on every page you're accessing? I would check to make sure there's

session_start();

Wherever necessary.

Also, what does

print_r( $_SESSION );

return? Anything at all? If not it would probably indicate what I was saying.

meder
Yes sessions is started and here is the kicker, I can access another set os sessions vars on the same page just not that one, im going to jkeep playing with it but this is a weird one
jasondavis
Is it possible you are unsetting it, or resetting it to a blank array? I would check all instances where you are assigning it.
meder
I can change the session name and then it all works so somewhere in my crazy complex app it must be killing that particular session name
jasondavis
yes what you posted, that must be the case somewhere in one of my files
jasondavis
A: 

I would check that you're not changing domains. E.G. domain.com -> www.domain.com

Normally a cookie is used to track the session id, and by default, the cookie is tied to a single domain. I.E. If the session was created at www.domain.com, when you visited login.domain.com the cookie wouldn't be sent resulting in no session information.

Matthew
A: 

it happened to me once .. maybe u have a similar scenario. the session variable was temp and i would destroy it once it was outputted to the screen.

with mod rewrite if u are routing everything , if there is a broken image , that might be redirected to ur php script as well , it would in the back ground print out the error and destroy that session var.

just a thought!

Sabeen Malik