ChipMaster's trial hacks on C++CMS starting with v1.2.1. Not sure I'll follow on with the v2 since it looks to be breaking and mostly frivolous.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

67 lines
1.8 KiB

  1. ///////////////////////////////////////////////////////////////////////////////
  2. //
  3. // Copyright (C) 2008-2012 Artyom Beilis (Tonkikh) <artyomtnk@yahoo.com>
  4. //
  5. // See accompanying file COPYING.TXT file for licensing details.
  6. //
  7. ///////////////////////////////////////////////////////////////////////////////
  8. #ifndef CPPCMS_SESSION_SID_H
  9. #define CPPCMS_SESSION_SID_H
  10. #include <cppcms/session_api.h>
  11. #include <cppcms/defs.h>
  12. #include <booster/hold_ptr.h>
  13. #include <booster/shared_ptr.h>
  14. #include <cppcms/session_storage.h>
  15. namespace cppcms {
  16. namespace sessions {
  17. namespace impl { class sid_generator; }
  18. ///
  19. /// \brief An implementation of session_api that stores the data using session_storage and unique session id.
  20. ///
  21. class CPPCMS_API session_sid : public session_api {
  22. public:
  23. ///
  24. /// Create a new session_sid with a pointer \a s to session_storage
  25. ///
  26. session_sid(booster::shared_ptr<session_storage> s);
  27. ///
  28. /// Delete an object and release a session_storage it used.
  29. ///
  30. ~session_sid();
  31. ///
  32. /// See session_api::save
  33. ///
  34. virtual void save(session_interface &,std::string const &data,time_t timeout,bool,bool);
  35. ///
  36. /// See session_api::load
  37. ///
  38. virtual bool load(session_interface &,std::string &data,time_t &timeout);
  39. ///
  40. /// See session_api::is_blocking
  41. ///
  42. virtual bool is_blocking();
  43. ///
  44. /// See session_api::clear
  45. ///
  46. virtual void clear(session_interface &);
  47. private:
  48. std::string get_new_sid();
  49. bool valid_sid(std::string const &cookie,std::string &id);
  50. struct _data;
  51. booster::hold_ptr<_data> d;
  52. booster::shared_ptr<session_storage> storage_;
  53. };
  54. } // sessions
  55. } // cppcms
  56. #endif