由于session导致的用户状态频繁丢失

福尔摩斯对我笑 2018-09-19 71377 次 10451条

今天收到用户的反馈,说登录后,经常会丢失登录的状态,导致下单时需要频繁登录。

收到反馈后,开始了测试,进行了数十次,并没有发现客户所反应的问题。后来我无意间切换了下网络,然后就发现问题重现了。经排查,发现该问题是由于Session导致的,尤其对于动态IP地址的客户,极为严重。

Ecshop默认的session机制

ecshop中的session和默认的session机制是不一样的。ecshop的session是自己定义的。
ecshop的session原理是基于cookie和ip综合处理生成的随即session字符串的。

ecshop的session就是当你建立一次会话之后,就会通过cookie和ip综合运算形成随即的session_id,存储在session表中。

Session建立的流程

当我们请求ecshop页面,那么就会建立session。

通过includes/init.php初始化

$sess = new cls_session($db, $ecs->table('sessions'), $ecs->table('sessions_data'));   //$sess就是新的session对象。

define('SESS_ID', $sess->get_session_id())

在session的类中, $GLOBALS['_SESSION'] = array();就是初始化session全局变量,$this->_ip = real_ip();

这就导致了session和ip有关。所以很多时候,在不同的浏览器下面,会造成session丢失。这个时候我们就该考虑到因为IP引起ecshop session的异常。

解决问题

所以我们需要修改Ecshop的源码,将session生成的机制重新做处理。

 

标签:

非特殊说明,本博所有文章均为博主原创。

头像也是LOGO
未来博客 博主大人
到了这个年纪,不应该再彷徨!

发表评论



 


已有 10451 条评论 1


  1. off white hoodie

    I wish to express thanks to the writer just for bailing me out of this issue. Right after looking out through the online world and meeting suggestions which were not productive, I believed my life was done. Being alive without the presence of strategies to the difficulties you have solved all through this website is a serious case, as well as the ones that would have adversely affected my career if I had not discovered the website. Your primary natural talent and kindness in playing with a lot of things was vital. I’m not sure what I would’ve done if I had not come across such a solution like this. It’s possible to at this moment look forward to my future. Thanks very much for this skilled and sensible help. I won’t hesitate to refer your web blog to anyone who wants and needs tips on this issue.

    回复 2019年11月4日
  2. air max 2018

    I needed to draft you one tiny word so as to thank you as before for the pleasant thoughts you have provided on this website. This has been really remarkably generous with people like you to offer without restraint what most people could have made available as an e-book in order to make some profit on their own, most importantly considering that you could possibly have done it in the event you desired. These good tips in addition acted to be the good way to be certain that other people have similar dream much like my personal own to understand somewhat more regarding this matter. I believe there are numerous more pleasant instances in the future for many who looked over your blog.

    回复 2019年11月3日
  3. yeezy

    I simply had to appreciate you once more. I am not sure the things that I might have sorted out without those tricks documented by you over this industry. It was the frustrating dilemma in my opinion, but understanding the specialised fashion you dealt with it made me to leap for contentment. Now i’m thankful for your guidance and even sincerely hope you find out what an amazing job you happen to be doing educating people via your website. Most probably you have never got to know all of us.

    回复 2019年11月3日
  4. hermes

    I am also commenting to let you know what a perfect experience my cousin’s girl developed reading through the blog. She learned many issues, which include how it is like to possess an excellent teaching character to get many more without problems comprehend a number of tortuous issues. You really did more than people’s expected results. Thank you for producing the priceless, dependable, explanatory as well as cool tips about the topic to Tanya.

    回复 2019年11月3日
  5. cheap jordans

    I wanted to write you a little bit of word just to say thanks a lot yet again over the amazing tips you’ve contributed here. It has been so pretty open-handed with people like you to supply freely precisely what many individuals might have offered as an e-book to help make some money for themselves, specifically since you could have tried it in the event you wanted. These principles in addition served to provide a great way to know that other people have similar keenness just like my very own to understand a great deal more with reference to this problem. I know there are lots of more pleasant periods ahead for those who examine your website.

    回复 2019年11月2日
  6. christian louboutin outlet

    I really wanted to develop a small remark so as to say thanks to you for all of the great secrets you are showing here. My time consuming internet investigation has at the end of the day been rewarded with reputable information to share with my pals. I ‘d express that many of us readers actually are unequivocally lucky to be in a notable network with very many marvellous individuals with very beneficial advice. I feel very much fortunate to have discovered the weblog and look forward to really more cool moments reading here. Thank you once again for all the details.

    回复 2019年11月2日
  7. hermes handbags

    Thank you so much for providing individuals with such a splendid opportunity to check tips from this site. It is often so fantastic and as well , full of fun for me and my office colleagues to search your site at a minimum thrice every week to see the new secrets you will have. And of course, I’m at all times contented for the terrific opinions served by you. Some 1 facts in this posting are undoubtedly the best I have ever had.

    回复 2019年11月2日
  8. longchamp handbags

    Thanks for your entire labor on this website. Kate loves participating in investigation and it’s really easy to see why. A number of us hear all regarding the lively manner you make very important tips and hints by means of this web blog and attract contribution from other people on the concern so our favorite girl has been being taught a lot. Take advantage of the rest of the year. You are carrying out a really good job.

    回复 2019年11月2日
  9. yeezy 500

    I simply wished to thank you so much once again. I am not sure the things I would’ve created without the solutions documented by you relating to such a concern. Completely was a real scary crisis in my opinion, nevertheless coming across this specialized fashion you managed that made me to leap with delight. I am thankful for the information and in addition wish you find out what an amazing job you are always carrying out educating the mediocre ones via a web site. I know that you haven’t got to know all of us.

    回复 2019年11月1日
  10. jordans

    I simply wanted to compose a brief note to express gratitude to you for those pleasant techniques you are giving on this website. My long internet lookup has now been rewarded with high-quality details to share with my companions. I ‘d suppose that many of us website visitors are definitely fortunate to exist in a fabulous site with so many brilliant people with good hints. I feel very much happy to have come across your entire site and look forward to some more excellent times reading here. Thanks a lot once again for everything.

    回复 2019年11月1日
  11. polo ralph lauren

    I wanted to send a simple message in order to appreciate you for all the remarkable ways you are giving out at this website. My prolonged internet search has at the end of the day been paid with really good facts and strategies to go over with my companions. I ‘d suppose that we website visitors actually are very fortunate to live in a really good place with very many perfect people with interesting suggestions. I feel somewhat lucky to have come across your web site and look forward to plenty of more thrilling minutes reading here. Thank you again for all the details.

    回复 2019年11月1日
  12. nhl jerseys

    I want to show some appreciation to you for bailing me out of such a instance. Because of searching through the internet and getting opinions that were not pleasant, I assumed my life was done. Living minus the answers to the issues you’ve sorted out as a result of your guide is a critical case, and the ones that could have in a negative way affected my career if I hadn’t come across your web site. Your actual ability and kindness in maneuvering a lot of stuff was vital. I’m not sure what I would’ve done if I hadn’t come upon such a point like this. I’m able to at this moment relish my future. Thanks for your time so much for this high quality and amazing help. I won’t think twice to recommend the blog to anyone who should have support on this problem.

    回复 2019年10月31日
  13. jordan shoes

    I actually wanted to jot down a comment to be able to thank you for all of the stunning recommendations you are posting at this site. My rather long internet look up has at the end been recognized with incredibly good facts to go over with my visitors. I would mention that many of us site visitors are quite blessed to be in a perfect network with very many special people with very beneficial opinions. I feel rather lucky to have encountered your entire web page and look forward to many more fabulous times reading here. Thank you once more for a lot of things.

    回复 2019年10月31日
  14. off white clothing

    I must convey my passion for your kind-heartedness in support of individuals that should have help on this one concept. Your special dedication to passing the solution up and down appears to be exceedingly insightful and has without exception enabled associates like me to realize their pursuits. Your personal warm and friendly help and advice entails a lot a person like me and somewhat more to my office colleagues. Thanks a lot; from everyone of us.

    回复 2019年10月31日
  15. supreme clothing

    I’m also commenting to let you be aware of what a impressive experience my wife’s princess found going through your web page. She figured out a lot of things, including how it is like to have an excellent helping character to make many more smoothly fully understand specific extremely tough things. You truly exceeded readers’ expectations. Thank you for providing these essential, trustworthy, explanatory and even unique guidance on this topic to Janet.

    回复 2019年10月30日
  16. yeezy shoes

    I and my buddies were found to be checking out the nice things located on the website and so all of a sudden I had a horrible suspicion I had not thanked the web blog owner for those secrets. All of the guys are actually so thrilled to read through them and have now in fact been making the most of these things. Appreciate your really being indeed kind as well as for picking out such good resources millions of individuals are really needing to discover. Our own sincere regret for not saying thanks to you sooner.

    回复 2019年10月30日
  17. kyrie 5 shoes

    My husband and i got cheerful when Michael managed to finish off his homework out of the ideas he grabbed using your web pages. It is now and again perplexing just to possibly be freely giving secrets and techniques that many many others may have been trying to sell. So we fully grasp we have got the website owner to give thanks to for that. All the explanations you have made, the simple site navigation, the friendships you assist to foster – it is many astounding, and it’s really assisting our son and us believe that this issue is brilliant, which is highly fundamental. Thanks for everything!

    回复 2019年10月30日
  18. valentino

    I enjoy you because of your own hard work on this website. My mum really loves managing internet research and it’s easy to understand why. We learn all of the lively method you provide worthwhile strategies via this web blog and therefore cause participation from the others on this idea while our own child is truly being taught so much. Enjoy the rest of the year. You’re doing a glorious job.

    回复 2019年10月30日
  19. balenciaga shoes

    I intended to post you this little observation to help say thank you over again just for the unique tricks you’ve shared here. This has been tremendously open-handed of people like you to present unhampered all that some people might have distributed as an e book to make some money on their own, and in particular given that you might have done it in the event you considered necessary. Those tactics additionally acted as the good way to fully grasp that most people have the same keenness just like my own to realize more with reference to this issue. I know there are numerous more pleasurable instances up front for those who read through your website.

    回复 2019年10月29日
  20. yeezy shoes

    I precisely wanted to thank you so much once again. I’m not certain the things I would’ve followed in the absence of the actual smart ideas revealed by you on such subject. It truly was a real alarming issue in my position, but finding out a expert form you processed that forced me to leap for fulfillment. I am just happy for the work and then sincerely hope you recognize what an amazing job your are doing educating other individuals thru a web site. Probably you have never come across all of us.

    回复 2019年10月29日
  21. nike air max 95

    I simply wanted to post a quick message to say thanks to you for all the splendid guides you are giving at this website. My prolonged internet look up has finally been paid with pleasant details to go over with my visitors. I would point out that most of us readers actually are very blessed to dwell in a useful network with very many wonderful individuals with very beneficial tricks. I feel very much fortunate to have come across the webpage and look forward to tons of more fabulous times reading here. Thank you once more for a lot of things.

    回复 2019年10月29日
  22. online pharmacy

    I think this is one of the most significant information for me.
    And i am glad reading your article. But want to remark on few
    general things, The web site style is great, the articles is really great : D.
    Good job, cheers

    回复 2019年10月28日
  23. hermes

    I definitely wanted to post a simple message so as to appreciate you for these amazing secrets you are writing here. My incredibly long internet lookup has at the end of the day been recognized with wonderful know-how to go over with my relatives. I ‘d admit that we readers are quite lucky to live in a decent place with very many wonderful professionals with very helpful tips. I feel somewhat lucky to have come across your entire site and look forward to tons of more excellent moments reading here. Thanks once again for all the details.

    回复 2019年10月28日
  24. nike air max 2017

    I in addition to my pals happened to be checking the excellent advice from the website then unexpectedly came up with a terrible feeling I had not thanked the blog owner for them. The young boys are already absolutely warmed to learn all of them and have now truly been using these things. Thank you for getting well thoughtful and for getting these kinds of essential useful guides millions of individuals are really needing to know about. Our own honest regret for not expressing appreciation to you sooner.

    回复 2019年10月28日
  25. balenciaga

    I not to mention my guys ended up looking at the nice information and facts found on your site and then at once came up with an awful feeling I had not thanked the blog owner for those strategies. My boys became for this reason stimulated to read them and already have quite simply been using these things. Many thanks for simply being very helpful and then for figuring out some notable areas most people are really needing to be informed on. Our own honest regret for not expressing appreciation to you sooner.

    回复 2019年10月28日
  26. lebron 13

    Thank you for your own labor on this web page. My niece loves working on internet research and it’s really easy to see why. Most people notice all concerning the powerful mode you produce valuable strategies via the web site and cause contribution from others on that subject matter so our child is certainly discovering a whole lot. Have fun with the rest of the new year. You’re carrying out a really great job.

    回复 2019年10月28日
  27. off white jordan 1

    I not to mention my pals came reading the nice guidelines on your web blog while the sudden got an awful feeling I had not thanked the site owner for them. The women became as a result happy to study all of them and have now pretty much been tapping into them. Appreciate your indeed being very considerate as well as for finding varieties of nice tips most people are really wanting to know about. Our own sincere apologies for not saying thanks to you sooner.

    回复 2019年10月27日
  28. hermes birkin

    Thanks a lot for providing individuals with an extraordinarily special chance to discover important secrets from this site. It can be so ideal and also stuffed with fun for me personally and my office peers to search your web site really three times a week to see the newest tips you have got. And indeed, I’m at all times impressed concerning the incredible advice you serve. Some 2 tips on this page are ultimately the best I’ve had.

    回复 2019年10月27日
  29. yeezy 700

    My spouse and i were very more than happy when Peter managed to deal with his researching via the precious recommendations he made from your very own site. It’s not at all simplistic to simply be making a gift of guides the rest might have been making money from. We really understand we have got the writer to be grateful to for that. The most important illustrations you have made, the easy web site menu, the relationships your site give support to promote – it’s got most exceptional, and it’s making our son and us feel that this theme is thrilling, and that is highly important. Thank you for all!

    回复 2019年10月27日
  30. kyrie 5

    I must point out my gratitude for your generosity supporting those individuals that must have assistance with this content. Your very own commitment to passing the message along ended up being extraordinarily invaluable and have surely enabled some individuals like me to attain their goals. The invaluable guidelines indicates so much a person like me and even more to my office workers. Best wishes; from each one of us.

    回复 2019年10月27日
  31. golden goose sneakers

    I am commenting to let you be aware of what a brilliant discovery my wife’s princess enjoyed browsing your site. She noticed a wide variety of things, with the inclusion of what it is like to possess an amazing coaching nature to have a number of people really easily know precisely a number of multifaceted subject areas. You truly did more than our expectations. Thanks for distributing the valuable, trustworthy, edifying and fun tips about the topic to Sandra.

    回复 2019年10月27日
  32. air max 270

    I in addition to my pals were actually looking at the good tricks found on your web site and instantly got a horrible feeling I never thanked the web site owner for those techniques. Most of the men ended up for this reason excited to see them and have really been having fun with those things. Thanks for genuinely so thoughtful and for having this sort of very good subject matter most people are really desperate to be aware of. Our own sincere regret for not expressing gratitude to earlier.

    回复 2019年10月26日
  33. golden goose sneakers

    I am just commenting to let you know what a wonderful encounter my wife’s princess experienced browsing yuor web blog. She came to find lots of pieces, including how it is like to have an excellent giving style to make a number of people clearly fully understand certain grueling subject areas. You truly exceeded readers’ expectations. Thank you for showing those warm and helpful, dependable, informative and also fun tips about that topic to Jane.

    回复 2019年10月26日
  34. kobe basketball shoes

    I in addition to my buddies were reading the nice information from your web site and so suddenly I had an awful feeling I never thanked the website owner for those techniques. Most of the ladies were definitely consequently passionate to learn them and have quite simply been enjoying these things. Thank you for actually being simply accommodating as well as for deciding on this sort of exceptional ideas most people are really eager to be aware of. My very own honest regret for not expressing gratitude to sooner.

    回复 2019年10月26日
  35. nike cortez women

    I want to show my appreciation for your kindness giving support to those people that must have help with this one matter. Your real dedication to getting the message all around ended up being amazingly advantageous and have encouraged women like me to arrive at their dreams. Your new invaluable useful information means so much a person like me and somewhat more to my colleagues. With thanks; from each one of us.

    回复 2019年10月25日
  36. longchamp

    A lot of thanks for your whole hard work on this web site. Betty really loves carrying out investigation and it’s obvious why. A lot of people learn all regarding the powerful medium you give both useful and interesting thoughts by means of the web site and strongly encourage participation from website visitors on the topic while our girl is truly becoming educated a lot. Enjoy the remaining portion of the year. You’re the one doing a dazzling job.

    回复 2019年10月25日
  37. curry 4

    My husband and i have been very lucky Chris could finish up his researching from the ideas he was given while using the web pages. It’s not at all simplistic to just always be giving for free methods which usually a number of people could have been selling. We take into account we’ve got the website owner to thank for that. The most important illustrations you’ve made, the straightforward blog navigation, the relationships you will aid to foster – it’s got all unbelievable, and it is helping our son and the family do think this subject matter is enjoyable, which is unbelievably serious. Thanks for everything!

    回复 2019年10月25日
  38. jordan shoes

    Thank you so much for providing individuals with remarkably special possiblity to read critical reviews from this blog. It is usually very beneficial and as well , stuffed with a good time for me personally and my office friends to search your website nearly 3 times in a week to find out the new secrets you will have. Not to mention, we are at all times pleased with all the great ideas served by you. Certain 1 areas in this post are basically the very best we’ve ever had.

    回复 2019年10月25日
  39. longchamp handbags

    A lot of thanks for every one of your hard work on this web site. My mom loves working on investigation and it is simple to grasp why. All of us notice all concerning the lively ways you make very helpful information via this web blog and even boost contribution from other ones on the subject plus our simple princess is truly understanding a whole lot. Enjoy the remaining portion of the new year. Your conducting a dazzling job.

    回复 2019年10月24日
  40. timberlands

    I definitely wanted to type a simple word in order to thank you for all of the precious facts you are sharing here. My incredibly long internet lookup has now been rewarded with incredibly good ideas to talk about with my close friends. I would tell you that many of us website visitors actually are really fortunate to be in a fine community with so many perfect individuals with helpful concepts. I feel extremely fortunate to have discovered your web site and look forward to some more entertaining moments reading here. Thank you once more for a lot of things.

    回复 2019年10月24日
  41. balenciaga sneakers

    I simply had to appreciate you once more. I am not sure the things that I would have handled in the absence of the actual tips contributed by you relating to that concern. It had been an absolute daunting condition for me personally, nevertheless discovering a new specialized technique you processed the issue forced me to cry over fulfillment. I will be thankful for this help and thus expect you are aware of an amazing job your are accomplishing teaching most people via your web blog. I am certain you haven’t come across all of us.

    回复 2019年10月24日
  42. nike shox for women

    I want to express my thanks to you for rescuing me from this particular scenario. Because of checking through the online world and coming across ways that were not powerful, I assumed my entire life was done. Being alive without the presence of strategies to the issues you’ve fixed all through this guideline is a crucial case, as well as ones that might have in a negative way damaged my career if I hadn’t noticed the website. Your primary understanding and kindness in controlling all areas was useful. I am not sure what I would’ve done if I had not encountered such a step like this. I’m able to at this point relish my future. Thanks a lot very much for this impressive and results-oriented help. I will not hesitate to suggest the sites to anyone who ought to have direction on this subject.

    回复 2019年10月23日
  43. yeezy boost

    I precisely desired to appreciate you again. I am not sure the things that I would’ve accomplished in the absence of the actual creative ideas contributed by you over this problem. Previously it was a very distressing crisis for me personally, but finding out the very skilled tactic you treated it took me to cry over delight. I’m happy for the service and in addition believe you are aware of a powerful job you happen to be putting in educating the others using a blog. I’m certain you’ve never got to know any of us.

    回复 2019年10月23日
  44. curry 6 shoes

    A lot of thanks for all your efforts on this web page. Gloria really likes managing internet research and it’s obvious why. We know all regarding the compelling mode you deliver invaluable tips via the website and even invigorate contribution from others on that matter plus our own princess is certainly being taught a great deal. Enjoy the remaining portion of the year. You are carrying out a great job.

    回复 2019年10月20日
  45. nike vapormax

    I precisely wished to appreciate you once more. I do not know the things I could possibly have tried in the absence of the creative ideas discussed by you over my industry. This was a hard situation in my view, but viewing this skilled fashion you handled that made me to jump for joy. Extremely grateful for this service as well as wish you are aware of a powerful job you were putting in instructing others all through your web site. More than likely you haven’t met any of us.

    回复 2019年10月19日
  46. yeezy boost 350

    I enjoy you because of all of your labor on this web page. Gloria takes pleasure in working on internet research and it is easy to see why. My partner and i notice all regarding the powerful mode you render insightful information on the web blog and as well as recommend participation from others about this matter while our own simple princess is actually being taught a whole lot. Take advantage of the remaining portion of the year. Your performing a really great job.

    回复 2019年10月15日
  47. off white x jordan 1

    I actually wanted to jot down a simple word to thank you for the splendid tips and tricks you are posting on this website. My extensive internet search has at the end been rewarded with good quality tips to share with my partners. I ‘d suppose that we readers actually are truly endowed to be in a magnificent community with so many marvellous professionals with helpful hints. I feel rather fortunate to have come across the web pages and look forward to some more cool moments reading here. Thank you again for all the details.

    回复 2019年10月13日
  48. yeezy shoes

    I wish to express my appreciation for your kindness in support of folks who must have help with your situation. Your personal commitment to passing the message across had been especially insightful and has surely empowered girls like me to realize their targets. The interesting guidelines entails much to me and still more to my peers. Warm regards; from everyone of us.

    回复 2019年10月12日
  49. jordan retro

    I happen to be writing to make you understand of the incredible experience my daughter experienced visiting your web page. She realized a wide variety of issues, not to mention what it’s like to possess an amazing giving mood to have many more without hassle learn specific very confusing subject matter. You truly surpassed her expectations. I appreciate you for delivering those precious, trusted, revealing and in addition cool thoughts on that topic to Sandra.

    回复 2019年10月9日
  50. balenciaga shoes

    I wanted to write down a brief message to be able to thank you for some of the great items you are placing at this site. My long internet search has at the end been honored with reasonable ideas to go over with my colleagues. I would claim that most of us website visitors are undeniably lucky to be in a very good website with so many awesome professionals with insightful guidelines. I feel rather fortunate to have discovered your entire web pages and look forward to some more awesome moments reading here. Thank you once more for everything.

    回复 2019年10月8日