Forum Moderators: coopster

Message Too Old, No Replies

PHP Session Lost Through .htaccess

can't call sessions from php file

         

inveni0

8:53 pm on Mar 8, 2008 (gmt 0)

10+ Year Member



So, I have an .htaccess file set up to redirect requests for an image to a php script which then redirects to the image's actual location. The reason I need a php script is because the image's location will be different depending on who is trying to access it.

I need to use sessions to tell the php file what folder to look in, but my sessions are lost when the .htaccess file calls the .php file. The .php file works fine when called from the browser.

Is there a workaround for this? A way to have my .php file call another .php file or something that would have the value?

All help is great!

coopster

6:18 pm on Mar 10, 2008 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



but my sessions are lost when the .htaccess file calls the .php file. The .php file works fine when called from the browser.

This isn't making sense to me. An .htaccess file cannot "call" a .php file. I'll assume for now you mean that it is redirecting the request. When the requested .php file is then retrieved, your session data should still be available. Are you using cookies? If so, are you using a different cookie name, domain or path?