It sounds to me like you are using OO code with a procedural model. For example, why would a User know how to handle cookies and deal with sessions? That would involve the User class knowing a bunch of stuff about your application and data storage that probably belong elsewhere, maybe in some kind of generic web framework code.
A more standard design for the kind of thing you seem to be doing would be to have your User class just model a user and the things that a user can do, with a separate class like UserManager that performs operations involving User objects. Registering a User should not change the basic identity of the User.
It sounds like you are kind of heading this way already. I would encourage to continue with that, and to read some stuff about OO modeling. In general, things that a user can do belong in the User class, while things your application can do with a user belong somewhere else.
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.