help with session breakdown [SOLVED]

#1
[eluser]dbashyal[/eluser]
my login was working suddenly session is not working. when i print_r the session i saw like this

Code:
[input] => ci_input Object
                (
                    [use_xss_clean] =>
                    [xss_hash] =>
                    [ip_address] =>
                    [user_agent] => Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.16) Gecko/20080702 Firefox/2.0.0.16
                    [allow_get_array] =>
                    [never_allowed_str] => Array
                        (
                            [[removed]] => [removed]
                            [[removed]] => [removed]
                            [[removed]] => [removed]
                            [[removed]] => [removed]
                            [[removed]] => [removed]
                            [[removed]] => [removed]
                            [<!--] => <!--
                            [-->] => -->
                            [<![CDATA[] => <![CDATA[
                        )

                    [never_allowed_regex] => Array
                        (
                            [javascript\s*:] => [removed]
                            [expression\s*\(] => [removed]
                            [Redirect\s+302] => [removed]
                        )

                )

i found <!-- after [removed]. do you know anything about this?

thanks.

#2
[eluser]dbashyal[/eluser]
some words are removed on previous post so, i have included screenshot now.
was session not working due to comment sign (<!--) appeared on session?

thanks.

#3
[eluser]dbashyal[/eluser]
[update]

i have a login script like this:

Quote:
Code:
function process_login($email, $password) {
        
        $CI =& get_instance();
        $sql = "SELECT * FROM `advertisers` WHERE `email` = ? AND `password` = ? LIMIT 1";
        $query = $CI->db->query($sql, array($email, $password));
        
        $numrows = $query->num_rows();
        
        if ($numrows == 1) {
            
            $CI->session->set_userdata('logged_in', true);
            $data = $query->result_array();
            $CI->session->set_userdata('LoggedData', $data);

            redirect('program', 'location');
            exit();

            return true;
            
        } else {
            
            $CI->session->set_userdata('login_errors', 'Invalid Login Data!');
            return false;
            
        }
        
    }

it doesn't set session LoggedData at all. It was working before but when i checked today i found login not working.

But if i comment out redirection part its ok, but i need to send user to program.

#4
[eluser]steelaz[/eluser]
I recently had a problem with IE rejecting session cookies. Are you working with IE? If so, check if FF is working.

#5
[eluser]dbashyal[/eluser]
I'm checking in both browsers. and got same error. Its not saving logged data in session at all. But if i remove redirect its ok. But its ok with other sites.

Found similar problem here, but not solved though.

http://ellislab.com/forums/viewthread/73629/

#6
[eluser]everdaniel[/eluser]
What version of CI are you using?

If you're using the latest version from the svn repository, remember the Session Lib changed around August 20 (if I recall correctly).

#7
[eluser]dbashyal[/eluser]
[quote author="everdaniel" date="1219654255"]What version of CI are you using?

If you're using the latest version from the svn repository, remember the Session Lib changed around August 20 (if I recall correctly).[/quote]

i don't use svn much, using the one that came with 1.6.3, do you think i should update with svn one. If so whats the URL.

#8
[eluser]steelaz[/eluser]
Attached is the latest Session.php , SVN updated few minutes ago (revision 1302)

#9
[eluser]dbashyal[/eluser]
[quote author="steelaz" date="1219655608"]Attached is the latest Session.php , SVN updated few minutes ago (revision 1302)[/quote]

Thanks. Updated with new one but still no solve. Sad

#10
[eluser]dbashyal[/eluser]
[update]

when i print_r just after storing data in session and before redirecting it shows that actually data is stored in session but when it is redirected to program page, session is lost.

The logged data is stored in session by Login Library, posted previously above.

I hope this will help someone to find the possible error.

Thanks.

[update]

The session is lost even if i click on another page link. so this is just not redirection problem. I set session expiration on config to 0 which says 0 means no expiry but still didn't work.

Anyone out there who had the same problem and solved it.

[update]

i thought session is lost only if i go to another page. when i click login its ok but if i press enter on the url bar on the same page after successful login also looses session and new session is created loosing all logged data.


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2019 MyBB Group.