Forum Moderators: coopster

Message Too Old, No Replies

SSL Session Problems

keeps dropping sessions

         

Scally_Ally

12:26 pm on Mar 22, 2007 (gmt 0)

10+ Year Member



I have an admin section for a shop i have built.
The administrator logs in and a session is set holding information about the administrator, This session is tested on every page to see whether it is an administrator requesting the page.

This all worked fine when i tested it on the server, but now that it has been put into secure space the session seems to be dropping out, forcing the user to re-login.

I havent changed where the dirctory is (its on the same server and also in the same directory)

I have checked through the code and there is only 1 session_start on every page.

The problem seems to occur when data is submitted, and the session is unset. I am uploading images so could maybe the enc_type of the form be affecting this?
Any suggestions please would be greatly appreciated.

Ally

mcibor

12:44 pm on Mar 22, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



The most often problem with session dropping out is that you are somewhere overwriting the variable.

It could be that register_globals is on, and one var has the same name as session variable

Also try this code:

if(isset($_SESSION['whatever_name_your_session_var_has'])) die('Session = '.$_SESSION['whatever_name_your_session_var_has']);
else die('Session is already unset');

use it to debug, where in the script you loose your session, and then check the script in that place.

It always helped me.
Hope it helps you as well
Regards
Michal

Scally_Ally

1:44 pm on Mar 22, 2007 (gmt 0)

10+ Year Member



Thanks that seemed to be the problem.
my session was called $_SESSION["admin"], changed the name and it works fine now.

What i would like to know is that why it would not work when it is on SSL, and work when it was on non-SSL.

Any ideas?

Ally

mcibor

2:46 pm on Mar 22, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



It could have sth to do with apache settings. SSL uses different ini files, as I recall. But I may err in this field

Glad it works, that's the most important!