Skip to content
This repository has been archived by the owner on Aug 17, 2020. It is now read-only.

Cookies #11

Closed
Shadow53 opened this issue Mar 22, 2016 · 4 comments
Closed

Cookies #11

Shadow53 opened this issue Mar 22, 2016 · 4 comments

Comments

@Shadow53
Copy link
Owner

Basically, if I refresh the teacher or admin pages, I have to type the password in again. I know nothing of setting cookies or the like, but perhaps there would be a way of providing authentication cookies for that particular page.

Plus: if the cookie for the queue admin page authenticates you for the teacher page as well, but not the other way around.

@Shadow53
Copy link
Owner Author

Shadow53 commented Apr 9, 2016

Okay, so I've had a bit of time to look into this and I found this library that allows cookie signing with this one. It looks like it'll be some work to implement, especially considering I know nothing about managing cookies.

@Shadow53 Shadow53 changed the title Any page requiring authentication does not remember it upon page refresh Cookies Apr 24, 2016
@Shadow53
Copy link
Owner Author

Turns out Express has its own cookie parser library it bundles with. It would be better to use that than to throw in yet more dependencies, so I'm going to try using that first.

@Shadow53
Copy link
Owner Author

After looking at the cookie parser library and the response.cookie() API here I have realized that I will need to rework how the whole login method works. The way to set a cookie is on a response to a request made by the browser. I should be able to make the modal make a request using $.ajax and, if the response contains a cookie, that should work.

Further work has found that I will need to (and really should) replace all of the communication with sockets with GET/POST requests and responses as per issue #20 before I can complete this. Therefore I am basically needing to rework the whole codebase to do this. It is a necessary thing, however, and I think I have learned my lesson.

@Shadow53
Copy link
Owner Author

Fixed in latest update with version 0.6.0.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant