开发者

While redirecting to secure server(ssl) in case data is huge , session is lost

开发者 https://www.devze.com 2023-01-19 01:19 出处:网络
In my application开发者_如何学C I need to use ssl. While redirecting from http//mydomain.com to https//mydomain.com session data is lost in case data is huge.

In my application开发者_如何学C 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.


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.


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.


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消