webmcp

view demo-app/app/main/_filter/20_session.lua @ 2:72860d232f32

Version 1.0.2

Fixed bug with explicit garbage collection (requests > 256kB caused an error)

Views prefixed with an underscore can't be called externally

ui.paginate now displays the last page, if the selected page number is too high.
author jbe/bsw
date Thu Dec 10 12:00:00 2009 +0100 (2009-12-10)
parents 9fdfb27f8e67
children 2169a62e12f5
line source
1 if cgi.cookies.session then
2 app.session = Session:by_ident(cgi.cookies.session)
3 end
4 if not app.session then
5 app.session = Session:new()
6 cgi.add_header('Set-Cookie: session=' .. app.session.ident .. '; path=/' )
7 end
9 request.set_csrf_secret(app.session.csrf_secret)
11 if app.session.user then
12 locale.set{ lang = app.session.user.lang or "en" }
13 end
15 if param.get("lang") then
16 locale.set{ lang = param.get("lang") }
17 end
19 execute.inner()

Impressum / About Us