Project

General

Profile

User register, authentication and cookie storage using Wt

Added by Alec Taylor almost 13 years ago

Good Morning,

I've read a few correspondances about Wt, including: http://discuss.joelonsoftware.com/default.asp?biz.5.599655.33

Can Wt be used for cookie orientated websites?

For instanced, I want people to be presented with one screen if they're logged in, and another if they aren't.

I want users to be able to register, and after they've registered/logged-in I want the server (FastCGI, not dedicated) to switch up to https

Does Wt support cookie-orientated web-development, or should I look at a different product, i.e.: CppCMS?

I'd really prefer to use Wt due to its widget orientated archiecture...

Anyways, please tell me what Wt supports in this realm.

Thanks,

Alec Taylor


Replies (6)

RE: User register, authentication and cookie storage using Wt - Added by Wim Dumon almost 13 years ago

Hi Alec,

Sure. Wt doesn't use cookies for session tracking, but you can set any cookies you want, and read them back.

To set cookies: WApplication::setCookie()

To read cookies: WEnvironment::cookies(), WEnvironment::getCookie()

Cookies are ideal to track users across sessions, on different tabs on the same browser, ...

Note that the environment is determined when the session is instantiated and is not modified afterward. So if you set a new value for a cookie, WEnvironment will still return the old value.

BR,

Wim.

RE: User register, authentication and cookie storage using Wt - Added by Alec Taylor almost 13 years ago

Hmm

I've been speaking with the CppCMS people (after this wasn't replied to for a few days) through StackOverflow, and CppCMS seems to be easier to implement... and more scalable.

However, Wt's widget based design could be very helpful for building my design...

So I'll get the user registration + login/logout working using both frameworks, then compare.

Are there any complete examples with user registration and authentication (login/logout)?

If not, are there any partial examples or tutorials?

Thanks for all suggestions,

Alec Taylor

RE: User register, authentication and cookie storage using Wt - Added by Wim Dumon almost 13 years ago

Alec,

To compensate for the delay, you get a quick response now :-)

The blog example (examples/blog) has user management and cookies to recognize returning users.

BR,

Wim.

RE: User register, authentication and cookie storage using Wt - Added by Alec Taylor almost 13 years ago

Thanks Wim

Would that be the same Blog as used on http://www.webtoolkit.eu/wt/blog?

Also, what you first said about cookies, does that mean I can't have a subdomain, i.e.: randomdomain.com/restricted/, which redirects to randomdomain.com/login/ with an error message?

RE: User register, authentication and cookie storage using Wt - Added by Wim Dumon almost 13 years ago

Hi Alec,

Yes that's the same blog code. The full source of the homepage is in examples/wt-homepage.

And no, my remark imposes no such limitations on cookies.

RE: User register, authentication and cookie storage using Wt - Added by Alec Taylor almost 13 years ago

Excellent, let the CppCMS<->Wt competition begin!

End result:

  • Website with a design utilising widget-type features, and a sidebar
  • User orientated (cookies: register, login, logout; check auth)

I'll begin coding in a few weeks, I'm currently in the middle of exams.

Should be an interesting project, with an interesting initial framework comparison! =]

_

Have similar project-based CppCMS vs Wt comparisons been done in the past?

    (1-6/6)