Hi webpy people,

i have some questions concerning the sessions, using MySQL and
the development server.

First, is the workaround for sessions in debug mode still required?

Second: I do not get any cookies sent back to the browser with
my test code and the session object is empty after going to
another page:

  db = web.database(dbn='mysql', user='unicorn', pw='robocop',
db='unicorn')
  app = web.application(urls, globals(), autoreload=True)
  store = web.session.DBStore(db, 'sessions')
  session = web.session.Session(app, store);

  class user:
      def GET(self, user_name):
          session.lol = 'whut'
          query_vars = dict(user_name=user_name)
          user = db.select('users', query_vars,
where="name=$user_name");

          web.header('Content-Type','text/html; charset=utf-8',
unique=True)
          return session.lol

Is the "header" function from web overwriting any headers sent
by the server? Anyway, the database table is not changed at all.

My db-Table looks like this BTW:

CREATE TABLE IF NOT EXISTS `sessions` (
  `session_id` char(128) COLLATE utf8_unicode_ci NOT NULL,
  `atime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `data` text COLLATE utf8_unicode_ci NOT NULL,
  UNIQUE KEY `session_id` (`session_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;


I am a bit lost with this simple task. I followed the examples
in the cookbooks. Could anybody help me?

Thanks in advance,
Dragan


-- 
http://noobz.cc/
http://digitalfolklore.org/

-- 
You received this message because you are subscribed to the Google Groups 
"web.py" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/webpy?hl=en.

Reply via email to