views:

15

answers:

3

In my application I need to use ssl. While redirecting from http//mydomain.com to https//mydomain.com session data is lost in case data is huge.

I have tried removing https to http, but still no use. My server is on a linux machine. Please help me out.

+1  A: 

Don't keep large amounts of data in the session itself. Instead, keep it in your friendly local database table (or tables) and only put the key into the table in the session. You could even make it so that the user can log out and log in from another machine and get back at that same data by making the data keyed "off their account" somehow.

In short, think carefully about what the lifetime of the data really should be. For large data, tying it to an HTTP session is probably the wrong approach as users tend to get upset when they have to reupload/recreate it because of a browser glitch.

Donal Fellows
A: 

How much data are we talking about? You shouldn't hold a lot of data in your sessions.

Also check if your session ID is the same when you redirect to HTTPS. I think you get a new cookie from HTTPS with new session ID, so the data is naturaly lost.

donis
Yes, amount of data is huge. Actually I found out the problem. Session was getting stored in database and the input type was "text" , now changed it to "longtext".
Dora
A: 

Hey guys, I found out the problem. I am using cake php application. Session was getting stored in database and the input type for storing session was "text" , now changed it to "longtext".

So the problem was solved.

Dora