开发者

Lazy Registration: How to let a guest user start their workflow and prompt registration when they try to save their work?

开发者 https://www.devze.com 2022-12-31 22:49 出处:网络
I\'m wondering what I would do to go about letting a guest use my web application without registering, then if they attempt to save their work they are prompted with a registration. This will be in a

I'm wondering what I would do to go about letting a guest use my web application without registering, then if they attempt to save their work they are prompted with a registration. This will be in a rails application by the way. Can I just allow public access to part of the work flow, then when they save check if they're a registered user (by session value, or cookie?). If they aren't a registered user, save all their work into the session and let them fill out a sign开发者_如何学编程 out form. On successful registration automatically log them in and initiate the create on the db?


You will want to keep track of data in the session. Some people suggest making a module or library to deal with data inside the session. For example, you might have a SessionCart class that deals with cart items in the session.

At the point the person decides to become a user, you can store some data in a cookie if you need to recreate the session.

0

精彩评论

暂无评论...
验证码 换一张
取 消