rangle / angular-ssr

Angular 4+ server-side rendering solution compatible with @angular/material, jQuery, and other libraries that touch the DOM (as well as providing a rich feature set!)
BSD 2-Clause "Simplified" License
279 stars 38 forks source link

How to access a cookie on both platforms #84

Open juanpmarin opened 7 years ago

juanpmarin commented 7 years ago

Hi, I need to access a cookie from server and browser, I thought about use a Varian but the cookie has not static values (it's an auth token), do you know a way to access it ? Thanks !

triadiprabowo commented 7 years ago

@juanpmarin have you find this solution?

juanpmarin commented 7 years ago

@triadiprabowo yes, but not using angular-ssr, I had to migrate to angular 5 and the express universal engine, angular 5 now comes with state transfer out of the box

juanpmarin commented 7 years ago

@triadiprabowo this is the implementation that I based on https://github.com/patrickmichalina/fusebox-angular-universal-starter/blob/master/src/client/app/shared/services/cookie.service.ts

triadiprabowo commented 7 years ago

@juanpmarin thank you man, it is working now. I used universal-starter (angular 5) and some setup from your given repo for cookies and state transfer.