Forum Moderators: coopster

Message Too Old, No Replies

Sessions Not Working

Webapp is fine locally but not on server

         

cabbagehead

6:25 pm on May 16, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Anyone ever seen this problem?

I'm using sessions to maintain a user's login state. It all works fine on my local machine where I built the webapp but sessions aren't carrying from page to page once I port the webapp to my server.

I did a couple tests - I can set and retrieve a session value on the same page...but I cannot set it on one page and retrieve it from another page.

Any thoughts would be appreciated...the techs at my hosting company seem to be stumped. :-\

Thanks.

coopster

6:30 pm on May 16, 2007 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



You are indeed starting the session on the following page with the same session name and cookie settings, correct?

cabbagehead

12:40 am on May 17, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Yep - its a direct copy/paste from where I show the value on the first page.

Actually - I've been reading some about this ... sounds like this can be an issue with directory permissions where PHP apparently writes to store this data? Apparently its *not* a RAM based thing? Anyway - I'm looking into this now.

colandy

11:12 am on May 17, 2007 (gmt 0)

10+ Year Member



Session data can be written to cookies or to the hard drive. The Session paths are specified in the PHPInfo details (PHP.ini file settings).

session.save_path is the variable your looking for alternatively session.cookie_path

On your local machine using your local web server you will have rights to any directory on the Hosts servers this is likely to be different. I would have thought that the hosts would have this already setup though.

You can check these directories on the host by uploading a page that has PHPinfo() on it.